Skip to content

Commit

Permalink
Fix KB buttons not opening the window in published binary
Browse files Browse the repository at this point in the history
  • Loading branch information
Coding-Enthusiast committed Jan 24, 2024
1 parent 5a8e461 commit 827096c
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 22 deletions.
1 change: 0 additions & 1 deletion Src/FinderOuter/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<!--Use Classes="Help" in any Button to change it into a round help button with "?" in it-->
<Style Selector="Button.Help">
<Setter Property="Command" Value="{Binding OpenKBCommand}" x:DataType="vm:ViewModelBase"/>
<Setter Property="CommandParameter" Value="Bitcoin"/>
<Setter Property="CornerRadius" Value="20"/>
<Setter Property="Margin" Value="6,6,5,5"/>
<Setter Property="Width" Value="25"/>
Expand Down
8 changes: 8 additions & 0 deletions Src/FinderOuter/ListHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,13 @@ public static IEnumerable<DescriptiveHelpInput> GetEnumDescHelpInput()
yield return new DescriptiveHelpInput(item);
}
}

public static IEnumerable<DescriptiveKB> GetEnumDescKB()
{
foreach (KB item in Enum.GetValues(typeof(KB)))
{
yield return new DescriptiveKB(item);
}
}
}
}
4 changes: 4 additions & 0 deletions Src/FinderOuter/Models/DescriptiveItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,8 @@ public class DescriptiveHelpInput(HelpInputTypes value) : DescriptiveItem<HelpIn
public class DescriptiveHelpInput2(HelpSecondInputTypes value) : DescriptiveItem<HelpSecondInputTypes>(value)
{
}

public class DescriptiveKB(KB value): DescriptiveItem<KB>(value)
{
}
}
8 changes: 4 additions & 4 deletions Src/FinderOuter/ViewModels/KnowledgeBaseViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public KnowledgeBaseViewModel()
Width = 850;
Height = 500;

KBList = ListHelper.GetEnumDescItems<KB>().ToArray();
KBList = ListHelper.GetEnumDescKB().ToArray();
}

public KnowledgeBaseViewModel(KB kb) : this()
Expand All @@ -32,10 +32,10 @@ public KnowledgeBaseViewModel(KB kb) : this()



public DescriptiveItem<KB>[] KBList { get; }
public DescriptiveKB[] KBList { get; }

private DescriptiveItem<KB> _selKb;
public DescriptiveItem<KB> SelectedKB
private DescriptiveKB _selKb;
public DescriptiveKB SelectedKB
{
get => _selKb;
set
Expand Down
2 changes: 1 addition & 1 deletion Src/FinderOuter/Views/KnowledgeBaseView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
SelectedItem="{Binding SelectedKB}"
Grid.Column="0">
<ListBox.ItemTemplate>
<DataTemplate DataType="{x:Type models:DescriptiveItem`1}">
<DataTemplate DataType="{x:Type models:DescriptiveKB}">
<TextBlock Text="{Binding Description}"/>
</DataTemplate>
</ListBox.ItemTemplate>
Expand Down
33 changes: 17 additions & 16 deletions Src/FinderOuter/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<DataTemplate DataType="{x:Type vm:HelpViewModel}">
<views:HelpView/>
</DataTemplate>

<DataTemplate DataType="{x:Type vm:MissingBase16ViewModel}">
<views:MissingBase16View/>
</DataTemplate>
Expand Down Expand Up @@ -117,13 +117,14 @@
<Grid ColumnDefinitions="auto,*" RowDefinitions="auto,auto,auto,auto" Grid.Column="0" Grid.Row="3" Background="#e5e5e5">
<Expander Header="Settings" Margin="5,0,0,10" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="0" IsExpanded="False">
<Grid ColumnDefinitions="auto,auto,*,auto,auto">
<Button Classes="Help"
FontSize="8"
Height="18" Width="18"
Margin="0,0,2,0"
VerticalAlignment="Center"
CommandParameter="{Binding ThreadKb}"
Grid.Column="0"/>
<Button Classes="Help"
FontSize="8"
Height="18" Width="18"
Margin="0,0,2,0"
VerticalAlignment="Center"
Command="{Binding OpenKBCommand}"
CommandParameter="{Binding ThreadKb}"
Grid.Column="0"/>
<TextBlock Text="Cores:" Grid.Column="1"/>
<Slider Value="{Binding Settings.CoreCount}"
Minimum="1"
Expand All @@ -146,14 +147,14 @@
<TextBlock Text="{Binding Settings.CoreCount}"
IsVisible="{Binding IsCappedSettings}"
Grid.Column="3"/>
<NumericUpDown Value="{Binding Settings.CoreCount}"
IsVisible="{Binding !IsCappedSettings}"
Height="40" Width="70"
Grid.Column="3"/>
<Button Content="Override" Command="{Binding OverrideSettings}"
IsEnabled="{Binding IsCappedSettings}"
Height="40"
Grid.Column="4"/>
<NumericUpDown Value="{Binding Settings.CoreCount}"
IsVisible="{Binding !IsCappedSettings}"
Height="40" Width="70"
Grid.Column="3"/>
<Button Content="Override" Command="{Binding OverrideSettings}"
IsEnabled="{Binding IsCappedSettings}"
Height="40"
Grid.Column="4"/>
</Grid>
</Expander>

Expand Down

0 comments on commit 827096c

Please sign in to comment.