Skip to content

Commit

Permalink
Add a Key to NumericUpDown Style (#1065)
Browse files Browse the repository at this point in the history
* Add a Key to NumericUpDown Style

add the key to be used with "MahApps:DataGridNumericUpDownColumn" "EditingElementStyle" to avoid the textbox Width problem

* add TargetType to NumericUpDown new key

add "TargetType" to "NumericUpDown" new key "MaterialDesignNumericUpDown" to automatically apply the style to all "NumericUpDown" controls
  • Loading branch information
ahmed-abdelrazek authored and Keboo committed Oct 28, 2018
1 parent d154950 commit 7880ac1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.MahApps;component/Themes/MaterialDesignTheme.MahApps.WindowCommands.xaml" />
</ResourceDictionary.MergedDictionaries>

<Style TargetType="{x:Type controls:NumericUpDown}" BasedOn="{StaticResource MaterialDesignNumericUpDown}" />
<Style TargetType="{x:Type controls:RangeSlider}" BasedOn="{StaticResource MaterialDesignRangeSlider}" />
</ResourceDictionary>
</ResourceDictionary>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<mahShared:ThicknessBindingConverter x:Key="ThicknessBindingConverter" />

<Style TargetType="{x:Type mah:NumericUpDown}">
<Style TargetType="{x:Type mah:NumericUpDown}" x:Key="MaterialDesignNumericUpDown">
<Setter Property="BorderThickness" Value="0,0,0,2" />
<Setter Property="mah:ControlsHelper.FocusBorderBrush" Value="{DynamicResource TextBoxFocusBorderBrush}" />
<Setter Property="mah:ControlsHelper.MouseOverBorderBrush" Value="{DynamicResource TextBoxMouseOverBorderBrush}" />
Expand Down Expand Up @@ -187,4 +187,4 @@
<Setter Property="UpDownButtonsWidth" Value="22" />
<Setter Property="Validation.ErrorTemplate" Value="{DynamicResource ValidationErrorTemplate}" />
</Style>
</ResourceDictionary>
</ResourceDictionary>

0 comments on commit 7880ac1

Please sign in to comment.