Merge pull request #274 from irihitech/calendar-dian

Extract Calendar colors
This commit is contained in:
Dong Bin
2024-06-27 17:34:38 +08:00
committed by GitHub
9 changed files with 224 additions and 95 deletions

View File

@@ -3,20 +3,22 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<Design.PreviewWith>
<StackPanel Margin="20" Spacing="5">
<u:CalendarView />
</StackPanel>
<ThemeVariantScope RequestedThemeVariant="Dark">
<StackPanel Width="600" Height="400">
<u:DatePicker HorizontalAlignment="Stretch" />
<u:DateRangePicker />
</StackPanel>
</ThemeVariantScope>
</Design.PreviewWith>
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:CalendarDayButton}" TargetType="u:CalendarDayButton">
<Setter Property="MinWidth" Value="32" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Margin" Value="0 2" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="MinWidth" Value="{DynamicResource CalenderDayMinWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource CalenderDayMinHeight}" />
<Setter Property="Margin" Value="{DynamicResource CalenderDayMargin}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CalenderDayBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderDayBorderThickness}" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayCornerRadius}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:CalendarDayButton">
<Panel>
@@ -38,96 +40,115 @@
</Setter>
<Style Selector="^:in-range">
<Setter Property="Background" Value="{DynamicResource SemiBlue1}" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Background" Value="{DynamicResource CalenderDayInRangeBackground}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayInRangeCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderDayNoBorderThickness}" />
</Style>
<Style Selector="^:today">
<Setter Property="Background" Value="{DynamicResource SemiGrey1}" />
<Setter Property="Foreground" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayTodayBackground}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderDayTodayForeground}" />
<Setter Property="Cursor" Value="Hand" />
<Style Selector="^:in-range">
<Setter Property="Background" Value="{DynamicResource CalenderDayInRangeBackground}" />
</Style>
</Style>
<Style Selector="^:not-current-month">
<Setter Property="Foreground" Value="{DynamicResource SemiGrey3}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderDayNotCurrentMonthForeground}" />
</Style>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiGrey1}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayPointeroverBackground}" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderDayPressedBackground}" />
</Style>
<Style Selector="^:selected">
<Setter Property="Background" Value="{DynamicResource SemiBlue5}" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{DynamicResource CalenderDaySelectedBackground}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderDayNoBorderThickness}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderDaySelectedForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Background" Value="{DynamicResource CalenderDaySelectedPointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderDaySelectedPressedBackground}" />
</Style>
</Style>
<Style Selector="^:start-date">
<Setter Property="CornerRadius" Value="3 0 0 3" />
<Setter Property="Background" Value="{DynamicResource SemiBlue5}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayStartDateCornerRadius}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayStartEndDateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CalenderDayStartEndDateBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderDaySelectedForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayStartEndDatePointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderDayStartEndDatePressedBackground}" />
</Style>
<Style Selector="^:in-range">
<Setter Property="BorderBrush" Value="{DynamicResource CalenderDayStartEndDateInRangeBackground}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderDayBorderThickness}" />
</Style>
</Style>
<Style Selector="^:start-date:in-range">
<Setter Property="CornerRadius" Value="3 0 0 3" />
<Setter Property="Background" Value="{DynamicResource SemiBlue5}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiGrey5}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="^:end-date">
<Setter Property="CornerRadius" Value="0 3 3 0" />
<Setter Property="Background" Value="{DynamicResource SemiBlue5}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiBlue5}" />
<Setter Property="Foreground" Value="White" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayEndDateCornerRadius}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayStartEndDateBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CalenderDayStartEndDateBorderBrush}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderDaySelectedForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayStartEndDatePointeroverBackground}" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderDayStartEndDatePressedBackground}" />
</Style>
<Style Selector="^:in-range">
<Setter Property="BorderBrush" Value="{DynamicResource CalenderDayStartEndDateInRangeBackground}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderDayBorderThickness}" />
</Style>
</Style>
<Style Selector="^:end-date:in-range">
<Setter Property="CornerRadius" Value="0 3 3 0" />
<Setter Property="Background" Value="{DynamicResource SemiBlue5}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiGrey5}" />
<Setter Property="BorderThickness" Value="1" />
</Style>
<Style Selector="^:preview-start-date">
<Setter Property="CornerRadius" Value="3 0 0 3" />
<Setter Property="Background" Value="{DynamicResource SemiBlue2}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiBlue2}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayStartDateCornerRadius}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayPreviewStartEndDateBackground}" />
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderDayPreviewStartEndDatePressedBackground}" />
</Style>
</Style>
<Style Selector="^:preview-end-date">
<Setter Property="CornerRadius" Value="0 3 3 0" />
<Setter Property="Background" Value="{DynamicResource SemiBlue2}" />
<Setter Property="BorderBrush" Value="{DynamicResource SemiBlue2}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderDayEndDateCornerRadius}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayPreviewStartEndDateBackground}" />
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderDayPreviewStartEndDatePressedBackground}" />
</Style>
</Style>
<Style Selector="^:blackout">
<Setter Property="Foreground" Value="{DynamicResource SemiGrey3}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderDayBlackoutForeground}" />
<Setter Property="Background" Value="{DynamicResource CalenderDayBlackoutBackground}" />
<Setter Property="Cursor" Value="No" />
<Style Selector="^:today">
<Setter Property="Foreground" Value="{DynamicResource CalenderDayBlackoutTodayBackground}" />
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:CalendarYearButton}" TargetType="u:CalendarYearButton">
<Setter Property="MinWidth" Value="32" />
<Setter Property="MinHeight" Value="32" />
<Setter Property="Margin" Value="0 2" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="MinWidth" Value="{DynamicResource CalenderYearMinWidth}" />
<Setter Property="MinHeight" Value="{DynamicResource CalenderYearMinHeight }" />
<Setter Property="Margin" Value="{DynamicResource CalenderYearMargin}" />
<Setter Property="Background" Value="{DynamicResource CalenderYearBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource CalenderYearBorderBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderYearBorderThickness}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderYearCornerRadius}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:CalendarDayButton">
<Panel>
@@ -148,24 +169,27 @@
</ControlTemplate>
</Setter>
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiGrey1}" />
<Setter Property="Background" Value="{DynamicResource CalenderYearPointeroverBackground}" />
<Setter Property="Cursor" Value="Hand" />
</Style>
<Style Selector="^:pressed">
<Setter Property="Background" Value="{DynamicResource CalenderYearPressedBackground}" />
</Style>
<Style Selector="^:selected">
<Setter Property="Background" Value="{DynamicResource SemiBlue5}" />
<Setter Property="CornerRadius" Value="3" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="White" />
<Setter Property="Background" Value="{DynamicResource CalenderYearSelectedBackground}" />
<Setter Property="CornerRadius" Value="{DynamicResource CalenderYearCornerRadius}" />
<Setter Property="BorderThickness" Value="{DynamicResource CalenderYearSelectedBorderThickness}" />
<Setter Property="Foreground" Value="{DynamicResource CalenderYearSelectedForeground}" />
<Style Selector="^:pointerover">
<Setter Property="Background" Value="{DynamicResource SemiBlue6}" />
<Setter Property="Background" Value="{DynamicResource CalenderYearSelectedPointeroverBackground}" />
</Style>
</Style>
</ControlTheme>
<ControlTheme x:Key="{x:Type u:CalendarView}" TargetType="u:CalendarView">
<Setter Property="MinHeight" Value="260" />
<Setter Property="MinWidth" Value="260" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="MinHeight" Value="{DynamicResource CalenderViewMinWidth}" />
<Setter Property="MinWidth" Value="{DynamicResource CalenderViewMinHeight}" />
<Setter Property="Background" Value="{DynamicResource DatePickerViewBackground}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:CalendarView">
<Grid Background="{TemplateBinding Background}" RowDefinitions="Auto, *">
@@ -180,8 +204,8 @@
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Width="{DynamicResource CalenderViewPathIconWidth}"
Height="{DynamicResource CalenderViewPathIconHeight}"
Data="{DynamicResource CalendarViewFastForwardGlyph}"
Foreground="{DynamicResource CalendarItemIconForeground}" />
</Button>
@@ -193,8 +217,8 @@
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Width="{DynamicResource CalenderViewPathIconWidth}"
Height="{DynamicResource CalenderViewPathIconHeight}"
Data="{DynamicResource CalendarItemPreviousIconGlyph}"
Foreground="{DynamicResource CalendarItemIconForeground}" />
</Button>
@@ -227,8 +251,8 @@
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Width="{DynamicResource CalenderViewPathIconWidth}"
Height="{DynamicResource CalenderViewPathIconHeight}"
Data="{DynamicResource CalendarItemNextIconGlyph}"
Foreground="{DynamicResource CalendarItemIconForeground}" />
</Button>
@@ -239,8 +263,8 @@
Foreground="{TemplateBinding Foreground}"
Theme="{DynamicResource BorderlessButton}">
<PathIcon
Width="12"
Height="12"
Width="{DynamicResource CalenderViewPathIconWidth}"
Height="{DynamicResource CalenderViewPathIconHeight}"
Data="{DynamicResource CalendarViewFastBackwardGlyph}"
Foreground="{DynamicResource CalendarItemIconForeground}" />
</Button>
@@ -264,4 +288,4 @@
</Setter>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -0,0 +1,41 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--CalenderDayButton-->
<SolidColorBrush x:Key="CalenderDayBackground" Color="Transparent" />
<SolidColorBrush x:Key="CalenderDayBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalenderDayInRangeBackground" Opacity="0.2" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDayTodayBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="CalenderDayTodayForeground" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDayNotCurrentMonthForeground" Color="#555B61" />
<SolidColorBrush x:Key="CalenderDayPointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="CalenderDayPressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="CalenderDaySelectedBackground" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDaySelectedForeground" Color="White" />
<SolidColorBrush x:Key="CalenderDaySelectedPointeroverBackground" Color="#7FC1FF" />
<SolidColorBrush x:Key="CalenderDaySelectedPressedBackground" Color="#A9D7FF" />
<SolidColorBrush x:Key="CalenderDayStartEndDateBackground" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDayStartEndDateBorderBrush" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDayStartEndDatePointeroverBackground" Color="#7FC1FF" />
<SolidColorBrush x:Key="CalenderDayStartEndDatePressedBackground" Color="#A9D7FF" />
<SolidColorBrush x:Key="CalenderDayStartEndDateInRangeBackground" Color="#A9D7FF" />
<SolidColorBrush x:Key="CalenderDayPreviewStartEndDateBackground" Opacity="0.3" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDayPreviewStartEndDatePressedBackground" Opacity="0.4" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderDayBlackoutForeground" Opacity="0.35" Color="#F9F9F9" />
<SolidColorBrush x:Key="CalenderDayBlackoutBackground" Opacity="0.04" Color="#E6E8EA" />
<SolidColorBrush x:Key="CalenderDayBlackoutTodayBackground" Color="#135CB8" />
<!--CalenderYearButton-->
<SolidColorBrush x:Key="CalenderYearBackground" Color="Transparent" />
<SolidColorBrush x:Key="CalenderYearBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalenderYearPointeroverBackground" Opacity="0.12" Color="White" />
<SolidColorBrush x:Key="CalenderYearPressedBackground" Opacity="0.16" Color="White" />
<SolidColorBrush x:Key="CalenderYearSelectedBackground" Color="#54A9FF" />
<SolidColorBrush x:Key="CalenderYearSelectedForeground" Color="White" />
<SolidColorBrush x:Key="CalenderYearSelectedPointeroverBackground" Color="#7FC1FF" />
<!--CalenderView-->
<SolidColorBrush x:Key="CalenderViewBackground" Color="Transparent" />
</ResourceDictionary>

View File

@@ -1,9 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="Badge.axaml" />
<MergeResourceInclude Source="Banner.axaml" />
<MergeResourceInclude Source="ButtonGroup.axaml" />
<MergeResourceInclude Source="DatePicker.axaml" />
<MergeResourceInclude Source="Dialog.axaml" />
<MergeResourceInclude Source="Divider.axaml" />
<MergeResourceInclude Source="DualBadge.axaml" />
@@ -15,6 +15,6 @@
<MergeResourceInclude Source="TagInput.axaml" />
<MergeResourceInclude Source="Timeline.axaml" />
<MergeResourceInclude Source="Skeleton.axaml" />
<MergeResourceInclude Source="TimeBox.axaml"/>
<MergeResourceInclude Source="TimeBox.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -0,0 +1,41 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--CalenderDayButton-->
<SolidColorBrush x:Key="CalenderDayBackground" Color="Transparent" />
<SolidColorBrush x:Key="CalenderDayBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalenderDayInRangeBackground" Color="#EAF5FF" />
<SolidColorBrush x:Key="CalenderDayTodayBackground" Opacity="0.05" Color="#2E3238" />
<SolidColorBrush x:Key="CalenderDayTodayForeground" Color="#0077FA" />
<SolidColorBrush x:Key="CalenderDayNotCurrentMonthForeground" Color="#A7ABB0" />
<SolidColorBrush x:Key="CalenderDayPointeroverBackground" Opacity="0.05" Color="#2E3238" />
<SolidColorBrush x:Key="CalenderDayPressedBackground" Opacity="0.09" Color="#2E3238" />
<SolidColorBrush x:Key="CalenderDaySelectedBackground" Color="#0077FA" />
<SolidColorBrush x:Key="CalenderDaySelectedForeground" Color="White" />
<SolidColorBrush x:Key="CalenderDaySelectedPointeroverBackground" Color="#0062D6" />
<SolidColorBrush x:Key="CalenderDaySelectedPressedBackground" Color="#004FB3" />
<SolidColorBrush x:Key="CalenderDayStartEndDateBackground" Color="#0077FA" />
<SolidColorBrush x:Key="CalenderDayStartEndDateBorderBrush" Color="#0077FA" />
<SolidColorBrush x:Key="CalenderDayStartEndDatePointeroverBackground" Color="#0062D6" />
<SolidColorBrush x:Key="CalenderDayStartEndDatePressedBackground" Color="#004FB3" />
<SolidColorBrush x:Key="CalenderDayStartEndDateInRangeBackground" Color="#004FB3" />
<SolidColorBrush x:Key="CalenderDayPreviewStartEndDateBackground" Color="#CBE7FE" />
<SolidColorBrush x:Key="CalenderDayPreviewStartEndDatePressedBackground" Color="#98CDFD" />
<SolidColorBrush x:Key="CalenderDayBlackoutForeground" Opacity="0.35" Color="#1C1F23" />
<SolidColorBrush x:Key="CalenderDayBlackoutBackground" Opacity="0.02" Color="#2E3238" />
<SolidColorBrush x:Key="CalenderDayBlackoutTodayBackground" Color="#98CDFD" />
<!--CalenderYearButton-->
<SolidColorBrush x:Key="CalenderYearBackground" Color="Transparent" />
<SolidColorBrush x:Key="CalenderYearBorderBrush" Color="Transparent" />
<SolidColorBrush x:Key="CalenderYearPointeroverBackground" Opacity="0.05" Color="#2E3238" />
<SolidColorBrush x:Key="CalenderYearPressedBackground" Opacity="0.09" Color="#2E3238" />
<SolidColorBrush x:Key="CalenderYearSelectedBackground" Color="#0077FA" />
<SolidColorBrush x:Key="CalenderYearSelectedForeground" Color="White" />
<SolidColorBrush x:Key="CalenderYearSelectedPointeroverBackground" Color="#0062D6" />
<!--CalenderView-->
<SolidColorBrush x:Key="CalenderViewBackground" Color="Transparent" />
</ResourceDictionary>

View File

@@ -1,9 +1,9 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="Badge.axaml" />
<MergeResourceInclude Source="Banner.axaml" />
<MergeResourceInclude Source="ButtonGroup.axaml" />
<MergeResourceInclude Source="DatePicker.axaml" />
<MergeResourceInclude Source="Dialog.axaml" />
<MergeResourceInclude Source="Divider.axaml" />
<MergeResourceInclude Source="DualBadge.axaml" />
@@ -15,6 +15,6 @@
<MergeResourceInclude Source="TagInput.axaml" />
<MergeResourceInclude Source="Timeline.axaml" />
<MergeResourceInclude Source="Skeleton.axaml" />
<MergeResourceInclude Source="TimeBox.axaml"/>
<MergeResourceInclude Source="TimeBox.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -1,6 +1,30 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--CalenderDayButton-->
<x:Double x:Key="CalenderDayMinWidth">32</x:Double>
<x:Double x:Key="CalenderDayMinHeight">32</x:Double>
<Thickness x:Key="CalenderDayMargin">0 2</Thickness>
<Thickness x:Key="CalenderDayBorderThickness">1</Thickness>
<CornerRadius x:Key="CalenderDayCornerRadius">3</CornerRadius>
<CornerRadius x:Key="CalenderDayInRangeCornerRadius">0</CornerRadius>
<Thickness x:Key="CalenderDayNoBorderThickness">0</Thickness>
<CornerRadius x:Key="CalenderDayStartDateCornerRadius">3 0 0 3</CornerRadius>
<CornerRadius x:Key="CalenderDayEndDateCornerRadius">0 3 3 0</CornerRadius>
<!--CalenderYearButton-->
<x:Double x:Key="CalenderYearMinWidth">32</x:Double>
<x:Double x:Key="CalenderYearMinHeight">32</x:Double>
<Thickness x:Key="CalenderYearMargin">0 2</Thickness>
<Thickness x:Key="CalenderYearBorderThickness">1</Thickness>
<CornerRadius x:Key="CalenderYearCornerRadius">3</CornerRadius>
<Thickness x:Key="CalenderYearSelectedBorderThickness">0</Thickness>
<!--CalenderView-->
<x:Double x:Key="CalenderViewMinWidth">260</x:Double>
<x:Double x:Key="CalenderViewMinHeight">260</x:Double>
<x:Double x:Key="CalenderViewPathIconWidth">12</x:Double>
<x:Double x:Key="CalenderViewPathIconHeight">12</x:Double>
<StreamGeometry x:Key="CalendarViewFastForwardGlyph">M12.6185 4.39653C13.1272 4.92524 13.1272 5.78245 12.6185 6.31116L7.14483 12L12.6185 17.6888C13.1272 18.2176 13.1272 19.0748 12.6185 19.6035C12.1098 20.1322 11.285 20.1322 10.7763 19.6035L4.38153 12.9573C3.87282 12.4286 3.87282 11.5714 4.38153 11.0427L10.7763 4.39653C11.285 3.86782 12.1098 3.86782 12.6185 4.39653Z M19.6185 4.39653C20.1272 4.92524 20.1272 5.78245 19.6185 6.31116L14.1448 12L19.6185 17.6888C20.1272 18.2176 20.1272 19.0748 19.6185 19.6035C19.1098 20.1322 18.285 20.1322 17.7763 19.6035L11.3815 12.9573C10.8728 12.4286 10.8728 11.5714 11.3815 11.0427L17.7763 4.39653C18.285 3.86782 19.1098 3.86782 19.6185 4.39653Z</StreamGeometry>
<StreamGeometry x:Key="CalendarViewFastBackwardGlyph">M4.38153 4.39653C4.89024 3.86782 5.71502 3.86782 6.22373 4.39653L12.6185 11.0427C13.1272 11.5714 13.1272 12.4286 12.6185 12.9573L6.22373 19.6035C5.71502 20.1322 4.89024 20.1322 4.38153 19.6035C3.87282 19.0748 3.87282 18.2176 4.38153 17.6888L9.85517 12L4.38153 6.31116C3.87282 5.78245 3.87282 4.92524 4.38153 4.39653Z M11.3815 4.39653C11.8902 3.86782 12.715 3.86782 13.2237 4.39653L19.6185 11.0427C20.1272 11.5714 20.1272 12.4286 19.6185 12.9573L13.2237 19.6035C12.715 20.1322 11.8902 20.1322 11.3815 19.6035C10.8728 19.0748 10.8728 18.2176 11.3815 17.6888L16.8552 12L11.3815 6.31116C10.8728 5.78245 10.8728 4.92524 11.3815 4.39653Z</StreamGeometry>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -1,5 +1,4 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!-- Add Resources Here -->
<ResourceDictionary.MergedDictionaries>
<MergeResourceInclude Source="Badge.axaml" />
<MergeResourceInclude Source="Banner.axaml" />
@@ -19,6 +18,6 @@
<MergeResourceInclude Source="Skeleton.axaml" />
<MergeResourceInclude Source="ThemeSelector.axaml" />
<MergeResourceInclude Source="ToolBar.axaml" />
<MergeResourceInclude Source="TimeBox.axaml"/>
<MergeResourceInclude Source="TimeBox.axaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -169,9 +169,9 @@ public class CalendarDayButton : ContentControl
remove => RemoveHandler(DateSelectedEvent, value);
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
protected override void OnPointerReleased(PointerReleasedEventArgs e)
{
base.OnPointerPressed(e);
base.OnPointerReleased(e);
if (DataContext is DateTime d)
RaiseEvent(new CalendarDayButtonEventArgs(d) { RoutedEvent = DateSelectedEvent, Source = this });
}

View File

@@ -59,9 +59,9 @@ public class CalendarYearButton : ContentControl
IsEnabled = Content != null;
}
protected override void OnPointerPressed(PointerPressedEventArgs e)
protected override void OnPointerReleased(PointerReleasedEventArgs e)
{
base.OnPointerPressed(e);
base.OnPointerReleased(e);
RaiseEvent(new CalendarYearButtonEventArgs(Mode, this.CalendarContext.Clone())
{ RoutedEvent = ItemSelectedEvent, Source = this });
}