Skip to content

Commit

Permalink
Migrate Brushes and Converters to MaterialDesignThemes 5
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxhy committed Feb 21, 2025
1 parent 6bc3ed4 commit 818f031
Show file tree
Hide file tree
Showing 29 changed files with 92 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.ChangeKeyReference}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<TextBlock Text="{x:Static properties:Resources.AutoSwitchToAV2}" Padding="3" />
</StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.AuthenticateKey}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<wpfappctrls:NumericUpDownControl MinValue="0" MaxValue="255" CurrentValue="{Binding SAMProperties.AuthenticateKeyEntryIdentifier, Mode=TwoWay}"
HelperText="{x:Static properties:Resources.KeyEntryIdentifierHelper}"
Hint="{x:Static properties:Resources.KeyEntryIdentifier}" Margin="5"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@
<materialDesign:Card Margin="5">
<StackPanel>
<Expander HorizontalAlignment="Stretch" HorizontalContentAlignment="Center" Header="{x:Static properties:Resources.SAMVersions}" IsExpanded="False">
<WrapPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<WrapPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Button Content="{x:Static properties:Resources.GetSAMVersion}" Command="{Binding SAMGetVersionCommand}" Margin="5" />
<Button Content="{x:Static properties:Resources.SwitchToAV2}" Command="{Binding SAMSwitchAV2Command}" Margin="5" />
<Button Content="{x:Static properties:Resources.ActivateMifareSAM}" Command="{Binding SAMActivateMifareSAMCommand}" Margin="5" />
</WrapPanel>
</Expander>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.SAMAuthentication}" IsExpanded="False">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -54,7 +54,7 @@
</StackPanel>
</Expander>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.SAMLockUnlock}" IsExpanded="False">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -74,7 +74,7 @@
</StackPanel>
</Expander>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.DESFireAuthenticate}" IsExpanded="False">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -90,18 +90,18 @@
</Grid.ColumnDefinitions>
<local:LLAReaderControl Grid.Row="0" Grid.ColumnSpan="2" ReaderProvider="{Binding RFIDReaderProvider, Mode=TwoWay}" ReaderUnit="{Binding RFIDReaderUnit, Mode=TwoWay}" />
<wpfappctrls:NumericUpDownControl Grid.Row="1" Grid.Column="0" MinValue="0" MaxValue="255" Margin="5"
CurrentValue="{Binding SAMDESFireKeyId, Mode=TwoWay}"
CurrentValue="{Binding SAMDESFireKeyId, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
HelperText="{x:Static properties:Resources.KeyEntryIdentifierHelper}"
Hint="{x:Static properties:Resources.KeyEntryIdentifier}"/>
<wpfappctrls:NumericUpDownControl Grid.Row="1" Grid.Column="1" MinValue="0" MaxValue="255" Margin="5"
CurrentValue="{Binding SAMDESFireKeyVersion, Mode=TwoWay}"
CurrentValue="{Binding SAMDESFireKeyVersion, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
HelperText="{x:Static properties:Resources.KeyVersionHelper}"
Hint="{x:Static properties:Resources.KeyVersion}"/>
<TextBox Grid.Row="2" Grid.Column="0" Text="{Binding DESFireAID, Mode=TwoWay, Converter={StaticResource ByteArrayToStringConverter}}"
materialDesign:HintAssist.HelperText="{x:Static properties:Resources.DESFireAIDHelper}"
materialDesign:HintAssist.Hint="{x:Static properties:Resources.DESFireAID}" Margin="5,5,5,10"/>
<wpfappctrls:NumericUpDownControl Grid.Row="2" Grid.Column="1" MinValue="0" MaxValue="255" Margin="5"
CurrentValue="{Binding DESFireKeyNum, Mode=TwoWay}"
CurrentValue="{Binding DESFireKeyNum, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
HelperText="{x:Static properties:Resources.DESFireKeyNumberHelper}"
Hint="{x:Static properties:Resources.DESFireKeyNumber}"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" Margin="5">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<materialDesign:Card Margin="5,15,5,5">
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="Counter" IsExpanded="True">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.Options}" IsExpanded="True">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
Expand Down Expand Up @@ -105,7 +105,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.KUC}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand All @@ -126,7 +126,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.DESFire}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
x:Name="window"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance domain:SAMAccessControlWizardWindowViewModel}"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
Background="{DynamicResource MaterialDesign.Brush.Background}"
FontFamily="{DynamicResource MaterialDesignFont}"
Title="{x:Static properties:Resources.AccessControlWizard}" Height="600" Width="800" WindowStartupLocation="CenterOwner">
<Window.Resources>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<RowDefinition/>
</Grid.RowDefinitions>
<WrapPanel Grid.Row="0" Orientation="Vertical" HorizontalAlignment="Center" Margin="24,8,24,16"
TextBlock.Foreground="{DynamicResource MaterialDesignBody}">
TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}">
<Button Content="{x:Static properties:Resources.ToolsSecurEvoDefault}"
Command="{Binding SAM_SEDefaultConfigFileCommand}"
Margin="5" />
Expand Down Expand Up @@ -69,7 +69,7 @@
<Expander Grid.Row="1" HorizontalAlignment="Stretch" HorizontalContentAlignment="Center"
IsExpanded="{Binding LockedLevelExpanded}"
Header="{x:Static properties:Resources.ToolsLockUnlock}">
<WrapPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<WrapPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid Margin="0,0,0,10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.KeyEntryPolicies}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid Focusable="False" IsHitTestVisible="False">
<Grid.ColumnDefinitions>
<ColumnDefinition />
Expand Down Expand Up @@ -80,7 +80,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" IsExpanded="True" Header="{x:Static properties:Resources.Password}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,0,24,24">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,0,24,24">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90*"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.KeyEntryPolicies}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid Focusable="False" IsHitTestVisible="False">
<Grid.ColumnDefinitions>
<ColumnDefinition />
Expand Down Expand Up @@ -80,7 +80,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" IsExpanded="True" Header="{x:Static properties:Resources.DESFire}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
Expand Down Expand Up @@ -155,7 +155,7 @@
</CheckBox.ToolTip>
</CheckBox>
<Rectangle Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="3" Grid.RowSpan="2" Margin="-10,0,0,0"
RadiusX="10" RadiusY="10" Stroke="{DynamicResource MaterialDesignBody}" StrokeThickness="2"/>
RadiusX="10" RadiusY="10" Stroke="{DynamicResource MaterialDesign.Brush.Foreground}" StrokeThickness="2"/>
<CheckBox Grid.Row="1" Grid.Column="1" Margin="0,5,0,5" HorizontalAlignment="Left" VerticalAlignment="Center"
Content="{x:Static properties:Resources.KeyEntryDESFireEv2}"
IsChecked="{Binding SAM_SEDESFireProperties.Ev2}"/>
Expand Down Expand Up @@ -282,7 +282,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" IsExpanded="{Binding SAM_SEDESFireProperties.Div.Expanded}" Header="{x:Static properties:Resources.KeyEntryDESFireDiv}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid IsEnabled="{Binding SAM_SEDESFireProperties.ParamEnable}">
<Grid.RowDefinitions>
<RowDefinition />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" Header="{x:Static properties:Resources.KeyEntryPolicies}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid Focusable="False" IsHitTestVisible="False">
<Grid.ColumnDefinitions>
<ColumnDefinition />
Expand Down Expand Up @@ -80,7 +80,7 @@
<materialDesign:Card>
<StackPanel>
<Expander HorizontalAlignment="Stretch" IsExpanded="True" Header="{x:Static properties:Resources.KeyEntryDESFireRid}">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesignBody}" Margin="24,8,24,16">
<StackPanel Orientation="Vertical" TextBlock.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}" Margin="24,8,24,16">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition/>
Expand Down
4 changes: 4 additions & 0 deletions KeyManager.Library.UI/FavoriteKeyStoreSelectionControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
xmlns:properties="clr-namespace:Leosac.KeyManager.Library.UI.Properties"
mc:Ignorable="d"
d:DesignHeight="120" d:DesignWidth="500">
<UserControl.Resources>
<materialDesign:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" TrueValue="Visible" FalseValue="Collapsed" />
<materialDesign:BooleanToVisibilityConverter x:Key="InverseBooleanToVisibilityConverter" TrueValue="Collapsed" FalseValue="Visible" />
</UserControl.Resources>
<StackPanel>
<materialDesign:DialogHost DialogTheme="Inherit"
Identifier="FavSelectionDialog">
Expand Down
7 changes: 5 additions & 2 deletions KeyManager.Library.UI/FolderBrowserDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
d:DataContext="{d:DesignInstance domain:FolderBrowserDialogViewModel}"
mc:Ignorable="d"
Title="{x:Static properties:Resources.SelectTargetFolder}" Height="450" Width="800" Loaded="Window_Loaded"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
Background="{DynamicResource MaterialDesign.Brush.Background}"
FontFamily="{DynamicResource MaterialDesignFont}">
<Window.Resources>
<materialDesign:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
</Window.Resources>
<Grid>
<DockPanel LastChildFill="True">
<WrapPanel DockPanel.Dock="Bottom" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,5,5,5">
Expand Down
1 change: 1 addition & 0 deletions KeyManager.Library.UI/KeyActionButtonsControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<UserControl.Resources>
<ResourceDictionary>
<s:Boolean x:Key="True">True</s:Boolean>
<materialDesign:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<libuidomain:NullToBooleanConverter x:Key="NullToBooleanConverter" />
</ResourceDictionary>
</UserControl.Resources>
Expand Down
4 changes: 2 additions & 2 deletions KeyManager.Library.UI/KeyCeremonyDialog.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
d:DesignHeight="550" d:DesignWidth="800"
Height="550" Width="800"
DataContextChanged="UserControl_DataContextChanged"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.Foreground="{DynamicResource MaterialDesign.Brush.Foreground}"
Background="{DynamicResource MaterialDesign.Brush.Background}"
FontFamily="{DynamicResource MaterialDesignFont}">
<Window.Resources>
<s:Boolean x:Key="True">True</s:Boolean>
Expand Down
Loading

0 comments on commit 818f031

Please sign in to comment.