Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Kinnara authored Nov 13, 2023
1 parent 0a05d10 commit 6031682
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
14 changes: 11 additions & 3 deletions ModernWpf.Controls/NumberBox/NumberBox.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
<Style.Setters>
<Setter Property="Focusable" Value="False" />
<Setter Property="Width" Value="40" />
<Setter Property="Height" Value="32" />
<Setter Property="Background" Value="{DynamicResource NumberBoxPopupSpinButtonBackground}" />
<Setter Property="BorderThickness" Value="{DynamicResource NumberBoxPopupSpinButtonBorderThickness}" />
<Setter Property="FontFamily" Value="{DynamicResource SymbolThemeFontFamily}" />
Expand Down Expand Up @@ -187,6 +186,7 @@
IsTabStop="False"
Visibility="Collapsed"
FontSize="{TemplateBinding FontSize}"
HorizontalAlignment="Right"
MinWidth="34"
VerticalAlignment="Stretch"
ui:TextBoxHelper.IsDeleteButton="True" />
Expand Down Expand Up @@ -259,6 +259,8 @@
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource TextControlBorderThemeThickness}"/>
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
Expand All @@ -268,7 +270,7 @@
<StreamGeometry x:Key="ChevronUp">M 19.091797 14.970703 L 10 5.888672 L 0.908203 14.970703 L 0.029297 14.091797 L 10 4.111328 L 19.970703 14.091797 Z</StreamGeometry>
</ControlTemplate.Resources>

<Grid ui:ThemeManager.HasThemeResources="True">
<Grid Height="{TemplateBinding Height}" ui:ThemeManager.HasThemeResources="True">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal" />
Expand Down Expand Up @@ -332,7 +334,7 @@

<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>

Expand Down Expand Up @@ -366,6 +368,10 @@
FontSize="{TemplateBinding FontSize}"
FontWeight="{TemplateBinding FontWeight}"
FontFamily="{TemplateBinding FontFamily}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="{TemplateBinding Padding}"
Foreground="{TemplateBinding Foreground}"
TextAlignment="{TemplateBinding TextAlignment}"
ui:ControlHelper.CornerRadius="{TemplateBinding CornerRadius}" />

Expand Down Expand Up @@ -416,6 +422,7 @@
Grid.Column="1"
Visibility="Collapsed"
FontSize="{TemplateBinding FontSize}"
BorderBrush="{TemplateBinding BorderBrush}"
Content="{StaticResource ChevronUp}"
Style="{StaticResource NumberBoxSpinButtonStyle}"
ui:ControlHelper.CornerRadius="0" />
Expand All @@ -426,6 +433,7 @@
Grid.Column="2"
Visibility="Collapsed"
FontSize="{TemplateBinding FontSize}"
BorderBrush="{TemplateBinding BorderBrush}"
Content="{StaticResource ChevronDown}"
Style="{StaticResource NumberBoxSpinButtonStyle}"
ui:ControlHelper.CornerRadius="{TemplateBinding CornerRadius, Converter={StaticResource RightCornerRadiusFilterConverter}}" />
Expand Down
11 changes: 9 additions & 2 deletions test/ModernWpfTestApp/NumberBoxPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,15 @@
<controls:NumberBox x:Name="HeaderTemplateTestingNumberBox"/>
</StackPanel>

<!-- FontSize propagation -->
<controls:NumberBox Header="Header text" FontSize="50"/>
<!-- Property propagation -->
<StackPanel Orientation="Horizontal">
<TextBoxEx Header="Header text" FontSize="14" Foreground="{ThemeResource SystemControlForegroundAccentBrush}"
Padding="20" Margin="20" BorderThickness="5" BorderBrush="Red"
Height="100" Width="200"/>
<controls:NumberBox Header="Header text" FontSize="14" Foreground="{ThemeResource SystemControlForegroundAccentBrush}" SpinButtonPlacementMode="Inline"
Padding="20" Margin="20" BorderThickness="5" BorderBrush="Red"
Height="100" Width="200"/>
</StackPanel>
</StackPanelEx>
</Grid>

Expand Down

0 comments on commit 6031682

Please sign in to comment.