|
2 | 2 | xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
3 | 3 | xmlns:mahShared="http://metro.mahapps.com/winfx/xaml/shared"
|
4 | 4 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
5 |
| - xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"> |
| 5 | + xmlns:mdix="http://materialdesigninxaml.net/winfx/xaml/themes"> |
6 | 6 | <ResourceDictionary.MergedDictionaries>
|
7 | 7 | <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.ValidationErrorTemplate.xaml" />
|
8 | 8 | </ResourceDictionary.MergedDictionaries>
|
|
12 | 12 | <Style TargetType="{x:Type mah:NumericUpDown}" x:Key="MaterialDesignNumericUpDown">
|
13 | 13 | <Setter Property="Background" Value="{DynamicResource MahApps.Brushes.Control.Background}" />
|
14 | 14 | <Setter Property="BorderBrush" Value="{DynamicResource MahApps.Brushes.TextBox.Border}" />
|
15 |
| - <Setter Property="BorderThickness" Value="1" /> |
| 15 | + <Setter Property="BorderThickness" Value="0 0 0 1"/> |
16 | 16 | <Setter Property="ContextMenu" Value="{DynamicResource MahApps.TextBox.ContextMenu}" />
|
17 | 17 | <Setter Property="mah:ControlsHelper.FocusBorderBrush" Value="{DynamicResource MahApps.Brushes.TextBox.FocusBorder}" />
|
18 | 18 | <Setter Property="mah:ControlsHelper.MouseOverBorderBrush" Value="{DynamicResource MahApps.Brushes.TextBox.MouseOverBorder}" />
|
|
31 | 31 | <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Hidden" />
|
32 | 32 | <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Hidden" />
|
33 | 33 | <Setter Property="SnapsToDevicePixels" Value="true" />
|
| 34 | + <Setter Property="mdix:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" /> |
34 | 35 | <Setter Property="Template">
|
35 | 36 | <Setter.Value>
|
36 | 37 | <ControlTemplate TargetType="{x:Type mah:NumericUpDown}">
|
|
47 | 48 | <ColumnDefinition x:Name="PART_MiddleColumn" Width="Auto" />
|
48 | 49 | <ColumnDefinition x:Name="PART_RightColumn" Width="Auto" />
|
49 | 50 | </Grid.ColumnDefinitions>
|
| 51 | + <Grid.RowDefinitions> |
| 52 | + <RowDefinition /> |
| 53 | + <RowDefinition Height="Auto" /> |
| 54 | + </Grid.RowDefinitions> |
50 | 55 | <TextBox x:Name="PART_TextBox"
|
51 | 56 | Grid.Column="0"
|
| 57 | + Grid.Row="0" |
52 | 58 | MinWidth="20"
|
53 | 59 | MinHeight="0"
|
54 | 60 | Margin="0"
|
|
71 | 77 | mah:TextBoxHelper.Watermark="{TemplateBinding mah:TextBoxHelper.Watermark}"
|
72 | 78 | mah:TextBoxHelper.WatermarkAlignment="{TemplateBinding mah:TextBoxHelper.WatermarkAlignment}"
|
73 | 79 | mah:TextBoxHelper.WatermarkTrimming="{TemplateBinding mah:TextBoxHelper.WatermarkTrimming}"
|
74 |
| - materialDesign:TextFieldAssist.DecorationVisibility="Collapsed" |
| 80 | + mdix:TextFieldAssist.DecorationVisibility="Collapsed" |
75 | 81 | Background="{x:Null}"
|
76 | 82 | BorderThickness="0"
|
77 | 83 | ContextMenu="{TemplateBinding ContextMenu}"
|
|
88 | 94 | VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" />
|
89 | 95 | <RepeatButton x:Name="PART_NumericUp"
|
90 | 96 | Grid.Column="1"
|
| 97 | + Grid.Row="0" |
91 | 98 | Width="{TemplateBinding UpDownButtonsWidth}"
|
92 | 99 | Margin="0"
|
93 | 100 | Delay="{TemplateBinding Delay}"
|
|
104 | 111 | </RepeatButton>
|
105 | 112 | <RepeatButton x:Name="PART_NumericDown"
|
106 | 113 | Grid.Column="2"
|
| 114 | + Grid.Row="0" |
107 | 115 | Width="{TemplateBinding UpDownButtonsWidth}"
|
108 | 116 | Margin="0"
|
109 | 117 | VerticalContentAlignment="Center"
|
|
119 | 127 | Fill="{DynamicResource MahApps.Brushes.Gray1}"
|
120 | 128 | Stretch="Fill" />
|
121 | 129 | </RepeatButton>
|
| 130 | + |
| 131 | + <mdix:Underline |
| 132 | + x:Name="Underline" |
| 133 | + Grid.Column="0" |
| 134 | + Grid.Row="1" |
| 135 | + Grid.ColumnSpan="3" |
| 136 | + Visibility="{Binding Path=(mdix:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}" |
| 137 | + CornerRadius="{Binding Path=(mdix:TextFieldAssist.UnderlineCornerRadius), RelativeSource={RelativeSource TemplatedParent}}" |
| 138 | + Background="{Binding Path=(mdix:TextFieldAssist.UnderlineBrush), RelativeSource={RelativeSource TemplatedParent}}" /> |
122 | 139 | </Grid>
|
123 | 140 | <Border x:Name="DisabledVisualElement"
|
124 | 141 | Background="{DynamicResource MahApps.Brushes.Controls.Disabled}"
|
|
227 | 244 | <Setter TargetName="PART_NumericDown" Property="Background" Value="{DynamicResource MahApps.Brushes.Black}" />
|
228 | 245 | <Setter TargetName="PolygonDown" Property="Fill" Value="{DynamicResource MahApps.Brushes.White}" />
|
229 | 246 | </Trigger>
|
230 |
| - <Trigger Property="IsMouseOver" Value="true"> |
| 247 | + <Trigger Property="IsMouseOver" Value="True"> |
231 | 248 | <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mah:ControlsHelper.MouseOverBorderBrush)}" />
|
232 | 249 | </Trigger>
|
233 |
| - <Trigger SourceName="PART_TextBox" Property="IsFocused" Value="true"> |
| 250 | + <Trigger SourceName="PART_TextBox" Property="IsFocused" Value="True"> |
234 | 251 | <Setter TargetName="Base" Property="BorderBrush" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(mah:ControlsHelper.FocusBorderBrush)}" />
|
235 | 252 | </Trigger>
|
| 253 | + <Trigger Property="IsKeyboardFocusWithin" Value="True"> |
| 254 | + <Setter TargetName="Underline" Property="IsActive" Value="True"/> |
| 255 | + </Trigger> |
236 | 256 | <Trigger Property="HideUpDownButtons" Value="True">
|
237 | 257 | <Setter TargetName="PART_NumericDown" Property="Visibility" Value="Collapsed" />
|
238 | 258 | <Setter TargetName="PART_NumericUp" Property="Visibility" Value="Collapsed" />
|
|
0 commit comments