Skip to content

Commit

Permalink
Added option to show/hide Exit in Nav bar. Closes #41.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timthreetwelve committed Sep 26, 2023
1 parent be65ee1 commit 907ce21
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
3 changes: 3 additions & 0 deletions WUView/Configuration/UserSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public partial class UserSettings : ConfigManager<UserSettings>
[ObservableProperty]
private bool _showDetails = true;

[ObservableProperty]
private bool _showExitInNav = true;

[ObservableProperty]
private bool _showLogWarnings = true;

Expand Down
1 change: 1 addition & 0 deletions WUView/Languages/Strings.en-US.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
<sys:String x:Key="SettingsItem_RowHeight">Row Height</sys:String>
<sys:String x:Key="SettingsItem_SelectFirstRow">Select first row on start</sys:String>
<sys:String x:Key="SettingsItem_ShowDetails">Show Details Panel</sys:String>
<sys:String x:Key="SettingsItem_ShowExit">Show Exit in Navigation bar</sys:String>
<sys:String x:Key="SettingsItem_ShowLogWarnings">Show warning messages in log for non-zero HResult values</sys:String>
<sys:String x:Key="SettingsItem_ShowTodayInBold">Show updates with current date in bold</sys:String>
<sys:String x:Key="SettingsItem_StartCentered">Start with window centered on screen</sys:String>
Expand Down
1 change: 1 addition & 0 deletions WUView/Languages/Strings.es-ES.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@
<sys:String x:Key="SettingsItem_RowHeight">Altura de la fila</sys:String>
<sys:String x:Key="SettingsItem_SelectFirstRow">Seleccionar la primera fila al inicio</sys:String>
<sys:String x:Key="SettingsItem_ShowDetails">Mostrar panel de detalles</sys:String>
<sys:String x:Key="SettingsItem_ShowExit">Mostrar Salida en la barra de navegación</sys:String>
<sys:String x:Key="SettingsItem_ShowLogWarnings">Mostrar mensajes de advertencia en el registro para valores HResult distintos de cero</sys:String>
<sys:String x:Key="SettingsItem_ShowTodayInBold">Mostrar actualizaciones con la fecha actual en negrita</sys:String>
<sys:String x:Key="SettingsItem_StartCentered">Empezar con la ventana centrada en la pantalla</sys:String>
Expand Down
15 changes: 15 additions & 0 deletions WUView/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@

<Window.Resources>
<config:UserSettings x:Key="config" />
<BooleanToVisibilityConverter x:Key="boolToVis" />
</Window.Resources>
<!--#endregion-->

Expand Down Expand Up @@ -164,6 +165,20 @@
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem"
BasedOn="{StaticResource MaterialDesignListBoxItem}">
<Style.Triggers>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding IsExit}" Value="True" />
<Condition Binding="{Binding Source={x:Static config:UserSettings.Setting}, Path=ShowExitInNav}" Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="Visibility" Value="Collapsed" />
</MultiDataTrigger>
</Style.Triggers>
</Style>
</ListBox.ItemContainerStyle>
<bh:Interaction.Triggers>
<bh:EventTrigger EventName="SelectionChanged">
<bh:InvokeCommandAction Command="{Binding NavigateCommand}"
Expand Down
5 changes: 5 additions & 0 deletions WUView/Views/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@
<Grid.RowDefinitions>
<RowDefinition Height="38" />
<RowDefinition Height="31" />
<RowDefinition Height="31" />
</Grid.RowDefinitions>
<CheckBox Grid.Row="0"
Content="{DynamicResource SettingsItem_StartCentered}"
Expand All @@ -339,6 +340,10 @@
Content="{DynamicResource SettingsItem_KeepOnTop}"
IsChecked="{Binding KeepOnTop,
Source={x:Static config:UserSettings.Setting}}" />
<CheckBox Grid.Row="2"
Content="{DynamicResource SettingsItem_ShowExit}"
IsChecked="{Binding ShowExitInNav,
Source={x:Static config:UserSettings.Setting}}" />
</Grid>
<!--#endregion-->
</Grid>
Expand Down

0 comments on commit 907ce21

Please sign in to comment.