Merge pull request #321 from irihitech/rc/293-backgroundsizing

Fix BackgroundSizing of TextBox, CalendarDatePicker, AutoCompleteBox, NumericUpDown
This commit is contained in:
Dong Bin 2024-03-20 21:14:21 +08:00 committed by GitHub
commit 8524e56166
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 214 additions and 181 deletions

View File

@ -17,69 +17,58 @@
<StackPanel.Styles> <StackPanel.Styles>
<Style Selector="AutoCompleteBox"> <Style Selector="AutoCompleteBox">
<Setter Property="Width" Value="300" /> <Setter Property="Width" Value="300" />
<Setter Property="ItemsSource">
<Binding Path="States" />
</Setter>
<Setter Property="ItemTemplate">
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</Setter>
</Style>
<Style Selector="AutoCompleteBox.Split">
<Setter Property="Width" Value="100" />
</Style> </Style>
</StackPanel.Styles> </StackPanel.Styles>
<StackPanel Orientation="Horizontal">
<AutoCompleteBox Classes="Split Large"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox Classes="Split"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox Classes="Split Small"
ValueMemberBinding="{ReflectionBinding Name}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<AutoCompleteBox Classes="Split"
IsEnabled="False"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox Classes="Split Bordered"
ValueMemberBinding="{ReflectionBinding Name}" />
<AutoCompleteBox Classes="Split Bordered"
IsEnabled="False"
ValueMemberBinding="{ReflectionBinding Name}" />
</StackPanel>
<AutoCompleteBox <AutoCompleteBox
ItemsSource="{Binding States}" Watermark="Please select a State"
ValueMemberBinding="{Binding Name}" ValueMemberBinding="{Binding Name}" />
Watermark="Please select a State">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
<AutoCompleteBox <AutoCompleteBox
Classes="Large" Classes="Large"
ItemsSource="{Binding States}" ValueMemberBinding="{ReflectionBinding Name}" />
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
<AutoCompleteBox <AutoCompleteBox
Classes="Small" Classes="Small"
ItemsSource="{Binding States}" ValueMemberBinding="{ReflectionBinding Name}" />
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
<AutoCompleteBox <AutoCompleteBox
Classes="Bordered" Classes="Bordered"
ItemsSource="{Binding States}" ValueMemberBinding="{ReflectionBinding Name}" />
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
<AutoCompleteBox <AutoCompleteBox
IsEnabled="False" IsEnabled="False"
ItemsSource="{Binding States}" Watermark="Disabled"
ValueMemberBinding="{ReflectionBinding Name}" ValueMemberBinding="{ReflectionBinding Name}" />
Watermark="Disabled"> <AutoCompleteBox
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
<AutoCompleteBox
InnerLeftContent="https://" InnerLeftContent="https://"
InnerRightContent=".com" InnerRightContent=".com"
ItemsSource="{Binding States}" ValueMemberBinding="{ReflectionBinding Name}" />
ValueMemberBinding="{ReflectionBinding Name}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate DataType="local:StateData">
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -8,11 +8,22 @@
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<CalendarDatePicker /> <StackPanel Orientation="Horizontal">
<CalendarDatePicker Classes="ClearButton" Width="200" /> <CalendarDatePicker Classes="Large" />
<CalendarDatePicker />
<CalendarDatePicker Classes="Small" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<CalendarDatePicker IsEnabled="False" />
<CalendarDatePicker Classes="Bordered" />
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel>
<CalendarDatePicker Width="500" /> <CalendarDatePicker Width="500" />
<CalendarDatePicker Classes="Large" />
<CalendarDatePicker Classes="Small" /> <CalendarDatePicker Classes="ClearButton" Width="200" />
<CalendarDatePicker <CalendarDatePicker
Name="DatePicker2" Name="DatePicker2"
Margin="0,0,0,8" Margin="0,0,0,8"
@ -23,9 +34,5 @@
CustomDateFormatString="ddd, MMM d" CustomDateFormatString="ddd, MMM d"
SelectedDateFormat="Custom" /> SelectedDateFormat="Custom" />
<CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" /> <CalendarDatePicker Margin="0,0,0,8" Watermark="Watermark" />
<CalendarDatePicker IsEnabled="False" />
<CalendarDatePicker Classes="Bordered" />
<CalendarDatePicker Classes="Bordered" IsEnabled="False" />
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -8,6 +8,24 @@
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<StackPanel Orientation="Horizontal">
<NumericUpDown Classes="Large" Width="150" ButtonSpinnerLocation="Left"/>
<NumericUpDown Width="150" ShowButtonSpinner="False" />
<NumericUpDown Classes="Small" Width="150" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<NumericUpDown Width="150" ButtonSpinnerLocation="Left" />
<NumericUpDown Width="150" ShowButtonSpinner="False" />
<NumericUpDown Width="150" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<NumericUpDown Width="150" ShowButtonSpinner="False" />
<NumericUpDown IsEnabled="False" Width="150" />
<NumericUpDown Width="150" ButtonSpinnerLocation="Left" />
</StackPanel>
<NumericUpDown <NumericUpDown
Width="200" Width="200"
Maximum="100" Maximum="100"
@ -44,4 +62,4 @@
Maximum="100" Maximum="100"
Minimum="0" /> Minimum="0" />
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@ -10,6 +10,18 @@
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer> <ScrollViewer>
<StackPanel HorizontalAlignment="Left" Spacing="20"> <StackPanel HorizontalAlignment="Left" Spacing="20">
<StackPanel Orientation="Horizontal">
<TextBox Classes="Large" Width="150"/>
<TextBox Width="150"/>
<TextBox Classes="Small" Width="150"/>
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBox IsEnabled="False" Width="150"/>
<TextBox Classes="Bordered" Width="150"/>
<TextBox Classes="Bordered" IsEnabled="False" Width="150"/>
</StackPanel>
<TextBox Width="300" /> <TextBox Width="300" />
<TextBox Width="300" Classes="Large" /> <TextBox Width="300" Classes="Large" />
<TextBox Width="300" Classes="Small" /> <TextBox Width="300" Classes="Small" />

View File

@ -9,6 +9,8 @@
</StackPanel> </StackPanel>
</Design.PreviewWith> </Design.PreviewWith>
<ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox"> <ControlTheme x:Key="{x:Type AutoCompleteBox}" TargetType="AutoCompleteBox">
<Setter Property="AutoCompleteBox.VerticalAlignment" Value="Center" />
<Setter Property="AutoCompleteBox.MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
<Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" /> <Setter Property="AutoCompleteBox.MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="AutoCompleteBox"> <ControlTemplate TargetType="AutoCompleteBox">
@ -16,7 +18,8 @@
<Panel> <Panel>
<TextBox <TextBox
Name="PART_TextBox" Name="PART_TextBox"
VerticalAlignment="Center" VerticalAlignment="Stretch"
MinHeight="0"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
Theme="{DynamicResource NonErrorTextBox}" Theme="{DynamicResource NonErrorTextBox}"
InnerLeftContent="{TemplateBinding InnerLeftContent}" InnerLeftContent="{TemplateBinding InnerLeftContent}"
@ -55,7 +58,8 @@
<Panel> <Panel>
<TextBox <TextBox
Name="PART_TextBox" Name="PART_TextBox"
VerticalAlignment="Center" VerticalAlignment="Stretch"
MinHeight="0"
Classes="Bordered" Classes="Bordered"
DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}" DataValidationErrors.Errors="{TemplateBinding (DataValidationErrors.Errors)}"
Watermark="{TemplateBinding Watermark}" /> Watermark="{TemplateBinding Watermark}" />
@ -85,15 +89,11 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
</Style> </Style>
<Style Selector="^.Large /template/ TextBox"> <Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small /template/ TextBox"> <Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxSmallHeight}" />
</Style> </Style>
</ControlTheme> </ControlTheme>
</ResourceDictionary> </ResourceDictionary>

View File

@ -9,12 +9,14 @@
<Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource CalendarDatePickerBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" /> <Setter Property="BorderThickness" Value="{DynamicResource CalendarDatePickerBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" /> <Setter Property="CornerRadius" Value="{DynamicResource CalendarDatePickerCornerRadius}" />
<Setter Property="BackgroundSizing" Value="OuterBorderEdge"/>
<Setter Property="IsTodayHighlighted" Value="True" /> <Setter Property="IsTodayHighlighted" Value="True" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="VerticalContentAlignment" Value="Center" /> <Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="8 0" /> <Setter Property="Padding" Value="8 0" />
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerDefaultHeight}" />
<Setter Property="Template"> <Setter Property="Template">
<ControlTemplate TargetType="CalendarDatePicker"> <ControlTemplate TargetType="CalendarDatePicker">
<DataValidationErrors> <DataValidationErrors>
@ -24,96 +26,96 @@
VerticalAlignment="Stretch"> VerticalAlignment="Stretch">
<Border <Border
x:Name="Background" x:Name="Background"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}"/>
<Grid <Grid
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
ColumnDefinitions="*, Auto, Auto">
<TextBox
Name="PART_TextBox"
Grid.Column="0"
Grid.ColumnSpan="2"
MinHeight="0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Center" VerticalAlignment="Stretch"
ColumnDefinitions="*, Auto, Auto"> HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
<TextBox VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Name="PART_TextBox" Background="Transparent"
Grid.Column="0" BorderBrush="Transparent"
Grid.ColumnSpan="2" BorderThickness="0"
MinHeight="{DynamicResource CalendarDatePickerDefaultHeight}" CornerRadius="{TemplateBinding CornerRadius}"
HorizontalAlignment="Stretch" Foreground="{TemplateBinding Foreground}"
VerticalAlignment="Center" Theme="{DynamicResource NonErrorTextBox}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" Watermark="{TemplateBinding Watermark}">
<TextBox.Styles>
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own focused state, override this to disable it here -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:disabled">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
</Style>
</TextBox.Styles>
</TextBox>
<Button
Name="ClearButton"
Grid.Column="1"
Padding="0,0,8,0"
Content="{DynamicResource IconButtonClearData}"
Command="{Binding $parent[CalendarDatePicker].Clear}"
Focusable="False"
IsVisible="False"
Theme="{DynamicResource InnerIconButton}" />
<Button
Name="PART_Button"
Grid.Column="2"
Padding="0,0,8,0"
Content="{DynamicResource CalendarDatePickerIconGlyph}"
Focusable="False"
Theme="{DynamicResource InnerIconButton}" />
<Popup
Name="PART_Popup"
Grid.Column="0"
HorizontalOffset="-8"
IsLightDismissEnabled="True"
PlacementTarget="{TemplateBinding}"
VerticalOffset="-4">
<Border
Margin="8"
Background="Transparent" Background="Transparent"
BorderBrush="Transparent" BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}"
BorderThickness="0" CornerRadius="{DynamicResource CalendarCornerRadius}">
CornerRadius="{TemplateBinding CornerRadius}" <Calendar
Foreground="{TemplateBinding Foreground}" Name="PART_Calendar"
Theme="{DynamicResource NonErrorTextBox}" BorderThickness="0"
UseFloatingWatermark="{TemplateBinding UseFloatingWatermark}" CornerRadius="{Binding $parent[Border].CornerRadius}"
Watermark="{TemplateBinding Watermark}"> DisplayDate="{TemplateBinding DisplayDate}"
<TextBox.Styles> DisplayDateEnd="{TemplateBinding DisplayDateEnd}"
<Style Selector="TextBox#PART_TextBox:pointerover /template/ Border#PART_ContentPresenterBorder"> DisplayDateStart="{TemplateBinding DisplayDateStart}"
<!-- By default the TextBox has its own focused state, override this to disable it here --> FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
<Setter Property="Background" Value="Transparent" /> IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}"
<Setter Property="BorderBrush" Value="Transparent" /> SelectedDate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedDate, Mode=TwoWay}">
<Setter Property="BorderThickness" Value="0" /> </Calendar>
</Style> </Border>
<Style Selector="TextBox#PART_TextBox:focus /template/ Border#PART_ContentPresenterBorder"> </Popup>
<!-- By default the TextBox has its own focused state, override this to disable it here --> </Grid>
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="TextBox#PART_TextBox:disabled">
<Style Selector="^ /template/ Border#PART_ContentPresenterBorder">
<!-- By default the TextBox has its own disabled state, override this to make the border background show through -->
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
</Style>
</TextBox.Styles>
</TextBox>
<Button
Name="ClearButton"
Grid.Column="1"
Padding="0,0,8,0"
Content="{DynamicResource IconButtonClearData}"
Command="{Binding $parent[CalendarDatePicker].Clear}"
Focusable="False"
IsVisible="False"
Theme="{DynamicResource InnerIconButton}" />
<Button
Name="PART_Button"
Grid.Column="2"
Padding="0,0,8,0"
Content="{DynamicResource CalendarDatePickerIconGlyph}"
Focusable="False"
Theme="{DynamicResource InnerIconButton}" />
<Popup
Name="PART_Popup"
Grid.Column="0"
HorizontalOffset="-8"
IsLightDismissEnabled="True"
PlacementTarget="{TemplateBinding}"
VerticalOffset="-4">
<Border
Margin="8"
Background="Transparent"
BoxShadow="{DynamicResource CalendarDatePickerPopupBoxShadows}"
CornerRadius="{DynamicResource CalendarCornerRadius}">
<Calendar
Name="PART_Calendar"
BorderThickness="0"
CornerRadius="{Binding $parent[Border].CornerRadius}"
DisplayDate="{TemplateBinding DisplayDate}"
DisplayDateEnd="{TemplateBinding DisplayDateEnd}"
DisplayDateStart="{TemplateBinding DisplayDateStart}"
FirstDayOfWeek="{TemplateBinding FirstDayOfWeek}"
IsTodayHighlighted="{TemplateBinding IsTodayHighlighted}"
SelectedDate="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=SelectedDate, Mode=TwoWay}">
</Calendar>
</Border>
</Popup>
</Grid>
</Border>
</Panel> </Panel>
</DataValidationErrors> </DataValidationErrors>
@ -128,14 +130,10 @@
</Style> </Style>
<Style Selector="^.Large"> <Style Selector="^.Large">
<Style Selector="^ /template/ TextBox#PART_TextBox"> <Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerLargeHeight}" />
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerInnerLargeHeight}" />
</Style>
</Style> </Style>
<Style Selector="^.Small"> <Style Selector="^.Small">
<Style Selector="^ /template/ TextBox#PART_TextBox"> <Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerSmallHeight}" />
<Setter Property="MinHeight" Value="{DynamicResource CalendarDatePickerInnerSmallHeight}" />
</Style>
</Style> </Style>
<Style Selector="^:pointerover"> <Style Selector="^:pointerover">

View File

@ -4,8 +4,10 @@
x:CompileBindings="True"> x:CompileBindings="True">
<!-- Add Resources Here --> <!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown"> <ControlTheme x:Key="{x:Type NumericUpDown}" TargetType="NumericUpDown">
<Setter Property="NumericUpDown.VerticalAlignment" Value="Center" />
<Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" /> <Setter Property="NumericUpDown.VerticalContentAlignment" Value="Center" />
<Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" /> <Setter Property="NumericUpDown.CornerRadius" Value="{DynamicResource NumericUpDownCornerRadius}" />
<Setter Property="NumericUpDown.MinHeight" Value="{DynamicResource NumericUpDownDefaultHeight}" />
<Setter Property="NumericUpDown.Template"> <Setter Property="NumericUpDown.Template">
<ControlTemplate TargetType="NumericUpDown"> <ControlTemplate TargetType="NumericUpDown">
<DataValidationErrors> <DataValidationErrors>
@ -23,7 +25,8 @@
<TextBox <TextBox
Name="PART_TextBox" Name="PART_TextBox"
Height="{TemplateBinding Height}" Height="{TemplateBinding Height}"
MinHeight="{DynamicResource NumericUpDownWrapperDefaultHeight}" MinHeight="0"
VerticalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
AcceptsReturn="False" AcceptsReturn="False"
@ -43,11 +46,11 @@
</ControlTemplate> </ControlTemplate>
</Setter> </Setter>
<Style Selector="^.Large /template/ TextBox#PART_TextBox"> <Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small /template/ TextBox#PART_TextBox"> <Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource NumericUpDownWrapperSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource NumericUpDownSmallHeight}" />
</Style> </Style>
<Style Selector="^:error"> <Style Selector="^:error">

View File

@ -53,11 +53,14 @@
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" /> <Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" /> <Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" /> <Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" /> <Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="TextBox.FontSize" Value="14" /> <Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" /> <Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" /> <Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" /> <Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
<Setter Property="TextBox.VerticalAlignment" Value="Center" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" /> <Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" /> <Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> <Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
@ -67,8 +70,8 @@
<DataValidationErrors> <DataValidationErrors>
<Border <Border
Name="PART_ContentPresenterBorder" Name="PART_ContentPresenterBorder"
MinHeight="{DynamicResource TextBoxWrapperDefaultHeight}"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">
@ -198,11 +201,11 @@
<Setter Property="IsVisible" Value="True" /> <Setter Property="IsVisible" Value="True" />
</Style> </Style>
</Style> </Style>
<Style Selector="^.Large /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^.Large">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperLargeHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource TextBoxLargeHeight}" />
</Style> </Style>
<Style Selector="^.Small /template/ Border#PART_ContentPresenterBorder"> <Style Selector="^.Small">
<Setter Property="MinHeight" Value="{DynamicResource TextBoxWrapperSmallHeight}" /> <Setter Property="MinHeight" Value="{DynamicResource TextBoxSmallHeight}" />
</Style> </Style>
<Style Selector="^.Bordered"> <Style Selector="^.Bordered">
@ -248,13 +251,15 @@
<Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" /> <Setter Property="TextBox.BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" /> <Setter Property="TextBox.SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />
<Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" /> <Setter Property="TextBox.SelectionForegroundBrush" Value="{DynamicResource TextBoxSelectionForeground}" />
<Setter Property="TextBox.BackgroundSizing" Value="OuterBorderEdge" />
<Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" /> <Setter Property="TextBox.BorderThickness" Value="{DynamicResource TextBoxBorderThickness}" />
<Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" /> <Setter Property="TextBox.CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="TextBox.FontSize" Value="14" /> <Setter Property="TextBox.FontSize" Value="14" />
<Setter Property="TextBox.Cursor" Value="Ibeam" /> <Setter Property="TextBox.Cursor" Value="Ibeam" />
<Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" /> <Setter Property="TextBox.CaretBrush" Value="{DynamicResource TextBoxTextCaretBrush}" />
<Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" /> <Setter Property="TextBox.Padding" Value="{DynamicResource TextBoxContentPadding}" />
<Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxWrapperDefaultHeight}" /> <Setter Property="TextBox.MinHeight" Value="{DynamicResource TextBoxDefaultHeight}" />
<Setter Property="TextBox.VerticalAlignment" Value="Center" />
<Setter Property="TextBox.VerticalContentAlignment" Value="Center" /> <Setter Property="TextBox.VerticalContentAlignment" Value="Center" />
<Setter Property="TextBox.FocusAdorner" Value="{x:Null}" /> <Setter Property="TextBox.FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" /> <Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
@ -266,6 +271,7 @@
Name="PART_ContentPresenterBorder" Name="PART_ContentPresenterBorder"
MinHeight="{TemplateBinding MinHeight}" MinHeight="{TemplateBinding MinHeight}"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
BackgroundSizing="{TemplateBinding BackgroundSizing}"
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}"> CornerRadius="{TemplateBinding CornerRadius}">

View File

@ -2,6 +2,7 @@
<Thickness x:Key="AutoCompleteBoxPopupBorderThickness">1</Thickness> <Thickness x:Key="AutoCompleteBoxPopupBorderThickness">1</Thickness>
<Thickness x:Key="AutoCompleteBoxPopupMargin">4</Thickness> <Thickness x:Key="AutoCompleteBoxPopupMargin">4</Thickness>
<CornerRadius x:Key="AutoCompleteBoxPopupCornerRadius">6</CornerRadius> <CornerRadius x:Key="AutoCompleteBoxPopupCornerRadius">6</CornerRadius>
<x:Double x:Key="AutoCompleteBoxDefaultHeight">32</x:Double>
<x:Double x:Key="AutoCompleteBoxSmallHeight">24</x:Double> <x:Double x:Key="AutoCompleteBoxSmallHeight">24</x:Double>
<x:Double x:Key="AutoCompleteBoxLargeHeight">40</x:Double> <x:Double x:Key="AutoCompleteBoxLargeHeight">40</x:Double>
<x:Double x:Key="AutoCompleteMaxDropdownHeight">600</x:Double> <x:Double x:Key="AutoCompleteMaxDropdownHeight">600</x:Double>

View File

@ -2,7 +2,7 @@
<StreamGeometry x:Key="CalendarDatePickerIconGlyph">M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z</StreamGeometry> <StreamGeometry x:Key="CalendarDatePickerIconGlyph">M4 20V8H20V20H4ZM2 4C2 2.89543 2.89543 2 4 2H20C21.1046 2 22 2.89543 22 4V20C22 21.1046 21.1046 22 20 22H4C2.89543 22 2 21.1046 2 20V4ZM6 10.5C6 10.2239 6.22386 10 6.5 10H8.5C8.77614 10 9 10.2239 9 10.5V12.5C9 12.7761 8.77614 13 8.5 13H6.5C6.22386 13 6 12.7761 6 12.5V10.5ZM6.5 15C6.22386 15 6 15.2239 6 15.5V17.5C6 17.7761 6.22386 18 6.5 18H8.5C8.77614 18 9 17.7761 9 17.5V15.5C9 15.2239 8.77614 15 8.5 15H6.5ZM10.5 10.5C10.5 10.2239 10.7239 10 11 10H13C13.2761 10 13.5 10.2239 13.5 10.5V12.5C13.5 12.7761 13.2761 13 13 13H11C10.7239 13 10.5 12.7761 10.5 12.5V10.5ZM11 15C10.7239 15 10.5 15.2239 10.5 15.5V17.5C10.5 17.7761 10.7239 18 11 18H13C13.2761 18 13.5 17.7761 13.5 17.5V15.5C13.5 15.2239 13.2761 15 13 15H11ZM15 10.5C15 10.2239 15.2239 10 15.5 10H17.5C17.7761 10 18 10.2239 18 10.5V12.5C18 12.7761 17.7761 13 17.5 13H15.5C15.2239 13 15 12.7761 15 12.5V10.5ZM15.5 15C15.2239 15 15 15.2239 15 15.5V17.5C15 17.7761 15.2239 18 15.5 18H17.5C17.7761 18 18 17.7761 18 17.5V15.5C18 15.2239 17.7761 15 17.5 15H15.5Z</StreamGeometry>
<Thickness x:Key="CalendarDatePickerBorderThickness">1</Thickness> <Thickness x:Key="CalendarDatePickerBorderThickness">1</Thickness>
<CornerRadius x:Key="CalendarDatePickerCornerRadius">3</CornerRadius> <CornerRadius x:Key="CalendarDatePickerCornerRadius">3</CornerRadius>
<x:Double x:Key="CalendarDatePickerInnerSmallHeight">22</x:Double>
<x:Double x:Key="CalendarDatePickerInnerLargeHeight">38</x:Double>
<x:Double x:Key="CalendarDatePickerDefaultHeight">32</x:Double> <x:Double x:Key="CalendarDatePickerDefaultHeight">32</x:Double>
<x:Double x:Key="CalendarDatePickerSmallHeight">24</x:Double>
<x:Double x:Key="CalendarDatePickerLargeHeight">40</x:Double>
</ResourceDictionary> </ResourceDictionary>

View File

@ -1,6 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<CornerRadius x:Key="NumericUpDownCornerRadius">3</CornerRadius> <CornerRadius x:Key="NumericUpDownCornerRadius">3</CornerRadius>
<x:Double x:Key="NumericUpDownWrapperDefaultHeight">32</x:Double> <x:Double x:Key="NumericUpDownDefaultHeight">32</x:Double>
<x:Double x:Key="NumericUpDownWrapperSmallHeight">24</x:Double> <x:Double x:Key="NumericUpDownSmallHeight">24</x:Double>
<x:Double x:Key="NumericUpDownWrapperLargeHeight">40</x:Double> <x:Double x:Key="NumericUpDownLargeHeight">40</x:Double>
</ResourceDictionary> </ResourceDictionary>

View File

@ -1,8 +1,7 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<x:Double x:Key="TextBoxSmallHeight">22</x:Double> <x:Double x:Key="TextBoxDefaultHeight">32</x:Double>
<x:Double x:Key="TextBoxWrapperDefaultHeight">32</x:Double> <x:Double x:Key="TextBoxSmallHeight">24</x:Double>
<x:Double x:Key="TextBoxWrapperSmallHeight">24</x:Double> <x:Double x:Key="TextBoxLargeHeight">40</x:Double>
<x:Double x:Key="TextBoxWrapperLargeHeight">40</x:Double>
<CornerRadius x:Key="TextBoxDefaultCornerRadius">3</CornerRadius> <CornerRadius x:Key="TextBoxDefaultCornerRadius">3</CornerRadius>