修复 DatePicker 和 DateRangePicker FontSize 在文本框上未生效的问题

This commit is contained in:
杨劼
2024-07-18 19:34:32 +08:00
parent f8a43fd126
commit d24ced3b0d
3 changed files with 6 additions and 3 deletions

View File

@@ -8,7 +8,7 @@
<StackPanel Margin="20" HorizontalAlignment="Left"> <StackPanel Margin="20" HorizontalAlignment="Left">
<u:CalendarView DateSelected="CalendarView_OnOnDateSelected" DatePreviewed="CalendarView_OnOnDatePreviewed"/> <u:CalendarView DateSelected="CalendarView_OnOnDateSelected" DatePreviewed="CalendarView_OnOnDatePreviewed"/>
<TextBlock Text="{Binding #singlePicker.SelectedDate}" ></TextBlock> <TextBlock Text="{Binding #singlePicker.SelectedDate}" ></TextBlock>
<u:DatePicker Name="singlePicker" Width="200" /> <u:DatePicker Name="singlePicker" Width="200" FontSize="20"/>
<u:DateRangePicker Width="300" DisplayFormat="yyyyMMdd" /> <u:DateRangePicker Width="300" DisplayFormat="yyyyMMdd" FontSize="20" />
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View File

@@ -42,6 +42,7 @@
BorderBrush="Transparent" BorderBrush="Transparent"
BorderThickness="0" BorderThickness="0"
CornerRadius="{TemplateBinding CornerRadius}" CornerRadius="{TemplateBinding CornerRadius}"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
InnerLeftContent="{TemplateBinding InnerLeftContent}" InnerLeftContent="{TemplateBinding InnerLeftContent}"
InnerRightContent="{TemplateBinding InnerRightContent}" InnerRightContent="{TemplateBinding InnerRightContent}"
@@ -76,8 +77,8 @@
Padding="8" Padding="8"
Background="{DynamicResource ComboBoxPopupBackground}" Background="{DynamicResource ComboBoxPopupBackground}"
BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}" BorderBrush="{DynamicResource ComboBoxPopupBorderBrush}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}" BorderThickness="{DynamicResource ComboBoxPopupBorderThickness}"
BoxShadow="{DynamicResource ComboBoxPopupBoxShadow}"
CornerRadius="{DynamicResource CalendarCornerRadius}"> CornerRadius="{DynamicResource CalendarCornerRadius}">
<u:CalendarView <u:CalendarView
Name="PART_Calendar" Name="PART_Calendar"

View File

@@ -35,6 +35,7 @@
Background="Transparent" Background="Transparent"
BorderThickness="1" BorderThickness="1"
CornerRadius="3 0 0 3" CornerRadius="3 0 0 3"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
InnerLeftContent="{TemplateBinding InnerLeftContent}" InnerLeftContent="{TemplateBinding InnerLeftContent}"
IsReadOnly="{TemplateBinding IsReadonly}" /> IsReadOnly="{TemplateBinding IsReadonly}" />
@@ -50,6 +51,7 @@
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
Background="Transparent" Background="Transparent"
CornerRadius="0" CornerRadius="0"
FontSize="{TemplateBinding FontSize}"
Foreground="{TemplateBinding Foreground}" Foreground="{TemplateBinding Foreground}"
InnerRightContent="{TemplateBinding InnerRightContent}" InnerRightContent="{TemplateBinding InnerRightContent}"
IsReadOnly="{TemplateBinding IsReadonly}" /> IsReadOnly="{TemplateBinding IsReadonly}" />