Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Rename PART_TextBox
  • Loading branch information
michaelmairegger committed Jun 24, 2024
commit 95bc2f20d81d1112b9aab05832d9f0d278f684e5
2 changes: 1 addition & 1 deletion src/MaterialDesignThemes.Wpf/NumericUpDown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class NumericUpDown : Control
{
public const string IncreaseButtonPartName = "PART_IncreaseButton";
public const string DecreaseButtonPartName = "PART_DecreaseButton";
public const string TextFieldBoxPartName = "PART_TextBoxField";
public const string TextFieldBoxPartName = "PART_TextBox";

private TextBox? _textBoxField;
private RepeatButton? _decreaseButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<converters:MathConverter x:Key="MathMultiplyConverter" Operation="Multiply" />
</ControlTemplate.Resources>
<Grid>
<TextBox x:Name="PART_TextBoxField"
<TextBox x:Name="PART_TextBox"
Padding="{TemplateBinding Padding, Converter={StaticResource NumericUpDownPaddingConverter}}"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
Expand Down Expand Up @@ -103,13 +103,13 @@
<RepeatButton x:Name="PART_DecreaseButton"
Margin="{TemplateBinding Padding, Converter={StaticResource PartButtonMarginConverter}}"
Style="{DynamicResource NestedNumericUpDownButtonsStyle}"
Foreground="{Binding ElementName=PART_TextBoxField, Path=Foreground}"
Foreground="{Binding ElementName=PART_TextBox, Path=Foreground}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Content="{TemplateBinding DecreaseContent}" />
<RepeatButton x:Name="PART_IncreaseButton"
Margin="{TemplateBinding Padding, Converter={StaticResource PartButtonMarginConverter}}"
Style="{DynamicResource NestedNumericUpDownButtonsStyle}"
Foreground="{Binding ElementName=PART_TextBoxField, Path=Foreground}"
Foreground="{Binding ElementName=PART_TextBox, Path=Foreground}"
Opacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
Content="{TemplateBinding IncreaseContent}" />
</StackPanel>
Expand Down Expand Up @@ -140,8 +140,8 @@

<!-- Validation.HasError -->
<Trigger Property="Validation.HasError" Value="True">
<Setter TargetName="PART_TextBoxField" Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ValidationError}" />
<Setter TargetName="PART_TextBoxField" Property="wpf:ValidationAssist.HasError" Value="True" />
<Setter TargetName="PART_TextBox" Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.ValidationError}" />
<Setter TargetName="PART_TextBox" Property="wpf:ValidationAssist.HasError" Value="True" />
</Trigger>
</ControlTemplate.Triggers>

Expand Down