|
15 | 15 | <Setter Property="BorderThickness" Value="0 0 0 1"/>
|
16 | 16 | <Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="0 0 0 0" />
|
17 | 17 | <Setter Property="Background" Value="Transparent"/>
|
18 |
| - <Setter Property="CaretBrush" Value="{Binding RelativeSource={RelativeSource Self}, Path=BorderBrush}"/> |
| 18 | + <Setter Property="CaretBrush" Value="{DynamicResource PrimaryHueMidBrush}"/> |
19 | 19 | <Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
|
20 | 20 | <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
|
21 | 21 | <Setter Property="VerticalContentAlignment" Value="Bottom"/>
|
|
50 | 50 | <Setter Property="Template">
|
51 | 51 | <Setter.Value>
|
52 | 52 | <ControlTemplate TargetType="{x:Type TextBox}">
|
53 |
| - <Grid> |
54 |
| - <Border x:Name="border" |
55 |
| - BorderBrush="{TemplateBinding BorderBrush}" |
56 |
| - BorderThickness="{TemplateBinding BorderThickness}" |
57 |
| - Background="{TemplateBinding Background}" |
58 |
| - SnapsToDevicePixels="True" |
59 |
| - Padding="0 4 0 4"> |
60 |
| - <Grid Margin="{TemplateBinding Padding}" |
61 |
| - VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
62 |
| - HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"> |
63 |
| - <ScrollViewer x:Name="PART_ContentHost" Focusable="false" |
64 |
| - HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" |
65 |
| - SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
66 |
| - UseLayoutRounding="{TemplateBinding UseLayoutRounding}" |
67 |
| - /> |
68 |
| - <wpf:SmartHint x:Name="Hint" |
69 |
| - Hint="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}" |
70 |
| - HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}" |
71 |
| - FontSize="{TemplateBinding FontSize}" |
72 |
| - Padding="{TemplateBinding Padding}" |
73 |
| - HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" |
74 |
| - UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}" |
75 |
| - FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}" |
76 |
| - FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}" |
77 |
| - /> |
78 |
| - </Grid> |
79 |
| - </Border> |
80 |
| - <wpf:Underline x:Name="Underline" Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/> |
81 |
| - </Grid> |
| 53 | + <Border x:Name="textFieldBoxBorder" |
| 54 | + SnapsToDevicePixels="True"> |
| 55 | + <Grid> |
| 56 | + <Border x:Name="border" |
| 57 | + BorderBrush="{TemplateBinding BorderBrush}" |
| 58 | + BorderThickness="{TemplateBinding BorderThickness}" |
| 59 | + Background="{TemplateBinding Background}" |
| 60 | + SnapsToDevicePixels="True" |
| 61 | + Padding="0 4 0 4"> |
| 62 | + <Grid x:Name="textFieldGrid" |
| 63 | + Margin="{TemplateBinding Padding}" |
| 64 | + VerticalAlignment="{TemplateBinding VerticalContentAlignment}" |
| 65 | + HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"> |
| 66 | + <ScrollViewer x:Name="PART_ContentHost" Focusable="false" |
| 67 | + HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden" |
| 68 | + SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" |
| 69 | + UseLayoutRounding="{TemplateBinding UseLayoutRounding}" |
| 70 | + /> |
| 71 | + <wpf:SmartHint x:Name="Hint" |
| 72 | + Hint="{Binding Path=(wpf:HintAssist.Hint), RelativeSource={RelativeSource TemplatedParent}}" |
| 73 | + HintProxy="{Binding RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static converters:HintProxyFabricConverter.Instance}}" |
| 74 | + FontSize="{TemplateBinding FontSize}" |
| 75 | + Padding="{TemplateBinding Padding}" |
| 76 | + HintOpacity="{Binding Path=(wpf:HintAssist.HintOpacity), RelativeSource={RelativeSource TemplatedParent}}" |
| 77 | + UseFloating="{Binding Path=(wpf:HintAssist.IsFloating), RelativeSource={RelativeSource TemplatedParent}}" |
| 78 | + FloatingScale="{Binding Path=(wpf:HintAssist.FloatingScale), RelativeSource={RelativeSource TemplatedParent}}" |
| 79 | + FloatingOffset="{Binding Path=(wpf:HintAssist.FloatingOffset), RelativeSource={RelativeSource TemplatedParent}}" |
| 80 | + /> |
| 81 | + </Grid> |
| 82 | + </Border> |
| 83 | + <wpf:Underline x:Name="Underline" Visibility="{Binding Path=(wpf:TextFieldAssist.DecorationVisibility), RelativeSource={RelativeSource TemplatedParent}}"/> |
| 84 | + </Grid> |
| 85 | + </Border> |
82 | 86 | <ControlTemplate.Triggers>
|
83 | 87 | <MultiTrigger>
|
84 | 88 | <MultiTrigger.Conditions>
|
|
91 | 95 | <Trigger Property="wpf:HintAssist.IsFloating" Value="True">
|
92 | 96 | <Setter TargetName="border" Property="Margin" Value="0 12 0 0" />
|
93 | 97 | </Trigger>
|
| 98 | + <Trigger Property="wpf:TextFieldAssist.HasTextFieldBox" Value="True"> |
| 99 | + <Setter Property="VerticalContentAlignment" Value="Top" /> |
| 100 | + <Setter TargetName="textFieldBoxBorder" Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" /> |
| 101 | + <Setter TargetName="textFieldBoxBorder" Property="CornerRadius" Value="4" /> |
| 102 | + <Setter TargetName="textFieldBoxBorder" Property="Padding" Value="0,8,0,0" /> |
| 103 | + <Setter TargetName="textFieldGrid" Property="Margin" Value="16,0,16,0" /> |
| 104 | + <Setter TargetName="border" Property="BorderThickness" Value="0" /> |
| 105 | + <Setter TargetName="Underline" Property="CornerRadius" Value="0,0,4,4" /> |
| 106 | + <Setter TargetName="Hint" Property="Margin" Value="0,0,0,16" /> |
| 107 | + <Setter TargetName="PART_ContentHost" Property="Margin" Value="0,8,0,8" /> |
| 108 | + </Trigger> |
| 109 | + <Trigger Property="wpf:TextFieldAssist.HasTextAreaBox" Value="True"> |
| 110 | + <Setter Property="VerticalContentAlignment" Value="Top" /> |
| 111 | + <Setter TargetName="textFieldBoxBorder" Property="Background" Value="Transparent" /> |
| 112 | + <Setter TargetName="textFieldBoxBorder" Property="CornerRadius" Value="4" /> |
| 113 | + <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="1" /> |
| 114 | + <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" /> |
| 115 | + <Setter TargetName="textFieldBoxBorder" Property="Padding" Value="0,8,0,0" /> |
| 116 | + <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-1" /> |
| 117 | + <Setter TargetName="textFieldGrid" Property="Margin" Value="16,0,16,0" /> |
| 118 | + <Setter TargetName="border" Property="BorderThickness" Value="0" /> |
| 119 | + <Setter TargetName="Underline" Property="Visibility" Value="Collapsed" /> |
| 120 | + <Setter TargetName="Hint" Property="Margin" Value="0,0,0,16" /> |
| 121 | + <Setter TargetName="PART_ContentHost" Property="Margin" Value="0,8,0,8" /> |
| 122 | + </Trigger> |
94 | 123 | <Trigger Property="IsEnabled" Value="false">
|
95 | 124 | <Setter Property="Opacity" TargetName="border" Value="0.56"/>
|
| 125 | + <Setter TargetName="textFieldBoxBorder" Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxDisabledBackground}" /> |
| 126 | + <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaInactiveBorder}" /> |
96 | 127 | </Trigger>
|
97 | 128 | <Trigger Property="IsMouseOver" Value="true">
|
98 | 129 | <Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}"/>
|
|
104 | 135 | <Setter Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}"/>
|
105 | 136 | <Setter TargetName="Underline" Property="Background" Value="{DynamicResource ValidationErrorBrush}"/>
|
106 | 137 | </Trigger>
|
| 138 | + <MultiTrigger> |
| 139 | + <MultiTrigger.Conditions> |
| 140 | + <Condition Property="IsMouseOver" Value="True" /> |
| 141 | + <Condition Property="wpf:TextFieldAssist.HasTextAreaBox" Value="True" /> |
| 142 | + </MultiTrigger.Conditions> |
| 143 | + <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" /> |
| 144 | + <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" /> |
| 145 | + </MultiTrigger> |
| 146 | + <MultiTrigger> |
| 147 | + <MultiTrigger.Conditions> |
| 148 | + <Condition Property="IsKeyboardFocused" Value="True" /> |
| 149 | + <Condition Property="wpf:TextFieldAssist.HasTextAreaBox" Value="True" /> |
| 150 | + </MultiTrigger.Conditions> |
| 151 | + <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" /> |
| 152 | + <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" /> |
| 153 | + <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" /> |
| 154 | + </MultiTrigger> |
| 155 | + <MultiTrigger> |
| 156 | + <MultiTrigger.Conditions> |
| 157 | + <Condition Property="Validation.HasError" Value="True" /> |
| 158 | + <Condition Property="wpf:TextFieldAssist.HasTextAreaBox" Value="True" /> |
| 159 | + </MultiTrigger.Conditions> |
| 160 | + <Setter TargetName="textFieldBoxBorder" Property="Margin" Value="-2" /> |
| 161 | + <Setter TargetName="textFieldBoxBorder" Property="BorderThickness" Value="2" /> |
| 162 | + <Setter TargetName="textFieldBoxBorder" Property="BorderBrush" Value="{DynamicResource ValidationErrorBrush}" /> |
| 163 | + </MultiTrigger> |
107 | 164 | </ControlTemplate.Triggers>
|
108 | 165 | </ControlTemplate>
|
109 | 166 | </Setter.Value>
|
|
123 | 180 | <Setter Property="wpf:HintAssist.IsFloating" Value="True"/>
|
124 | 181 | </Style>
|
125 | 182 |
|
| 183 | + <Style x:Key="MaterialDesignTextFieldBoxTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}"> |
| 184 | + <Setter Property="wpf:TextFieldAssist.HasTextFieldBox" Value="True" /> |
| 185 | + </Style> |
| 186 | + |
| 187 | + <Style x:Key="MaterialDesignTextAreaTextBox" TargetType="{x:Type TextBox}" BasedOn="{StaticResource MaterialDesignFloatingHintTextBox}"> |
| 188 | + <Setter Property="wpf:TextFieldAssist.HasTextAreaBox" Value="True" /> |
| 189 | + </Style> |
| 190 | + |
126 | 191 | </ResourceDictionary>
|
0 commit comments