mirror of
https://gitcode.com/gh_mirrors/se/Semi.Avalonia
synced 2026-04-22 09:26:35 +08:00
feat: enhance Previous & Next Button in Calendar.
This commit is contained in:
@@ -2,6 +2,11 @@
|
|||||||
xmlns="https://github.com/avaloniaui"
|
xmlns="https://github.com/avaloniaui"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
x:CompileBindings="True">
|
x:CompileBindings="True">
|
||||||
|
<Design.PreviewWith>
|
||||||
|
<Border Padding="20">
|
||||||
|
<Calendar />
|
||||||
|
</Border>
|
||||||
|
</Design.PreviewWith>
|
||||||
<ControlTheme x:Key="{x:Type Calendar}" TargetType="Calendar">
|
<ControlTheme x:Key="{x:Type Calendar}" TargetType="Calendar">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource CalendarForeground}" />
|
<Setter Property="Foreground" Value="{DynamicResource CalendarForeground}" />
|
||||||
<Setter Property="Background" Value="{DynamicResource CalendarBackground}" />
|
<Setter Property="Background" Value="{DynamicResource CalendarBackground}" />
|
||||||
@@ -59,18 +64,19 @@
|
|||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
RowDefinitions="Auto,*">
|
RowDefinitions="Auto,*">
|
||||||
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto">
|
<Grid Grid.Row="0" ColumnDefinitions="Auto,*,Auto">
|
||||||
<Button
|
<RepeatButton
|
||||||
Name="PART_PreviousButton"
|
Name="PART_PreviousButton"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
HorizontalContentAlignment="Left"
|
Padding="0"
|
||||||
|
MinWidth="{Binding $self.MinHeight}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Theme="{DynamicResource BorderlessButton}">
|
Theme="{DynamicResource BorderlessRepeatButton}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Theme="{DynamicResource InnerPathIcon}"
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
Data="{DynamicResource CalendarItemPreviousIconGlyph}"
|
Data="{DynamicResource CalendarItemPreviousIconGlyph}"
|
||||||
Foreground="{DynamicResource CalendarItemIconForeground}" />
|
Foreground="{DynamicResource CalendarItemIconForeground}" />
|
||||||
</Button>
|
</RepeatButton>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
Name="PART_HeaderButton"
|
Name="PART_HeaderButton"
|
||||||
@@ -79,18 +85,19 @@
|
|||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Theme="{DynamicResource BorderlessButton}" />
|
Theme="{DynamicResource BorderlessButton}" />
|
||||||
|
|
||||||
<Button
|
<RepeatButton
|
||||||
Name="PART_NextButton"
|
Name="PART_NextButton"
|
||||||
Grid.Column="2"
|
Grid.Column="2"
|
||||||
HorizontalContentAlignment="Left"
|
Padding="0"
|
||||||
|
MinWidth="{Binding $self.MinHeight}"
|
||||||
Foreground="{TemplateBinding Foreground}"
|
Foreground="{TemplateBinding Foreground}"
|
||||||
Theme="{DynamicResource BorderlessButton}">
|
Theme="{DynamicResource BorderlessRepeatButton}">
|
||||||
<PathIcon
|
<PathIcon
|
||||||
Theme="{DynamicResource InnerPathIcon}"
|
Theme="{DynamicResource InnerPathIcon}"
|
||||||
Classes="Large"
|
Classes="Large"
|
||||||
Data="{DynamicResource CalendarItemNextIconGlyph}"
|
Data="{DynamicResource CalendarItemNextIconGlyph}"
|
||||||
Foreground="{DynamicResource CalendarItemIconForeground}" />
|
Foreground="{DynamicResource CalendarItemIconForeground}" />
|
||||||
</Button>
|
</RepeatButton>
|
||||||
</Grid>
|
</Grid>
|
||||||
<Grid
|
<Grid
|
||||||
Name="PART_MonthView"
|
Name="PART_MonthView"
|
||||||
|
|||||||
Reference in New Issue
Block a user