A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

179 lines
7.2 KiB

<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ControlTheme x:Key="{x:Type CalendarItem}"
TargetType="CalendarItem">
<Setter Property="CornerRadius" Value="1" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
<Border Margin="0,2,0,2"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding CornerRadius}">
<Border BorderBrush="{DynamicResource ThemeBackgroundBrush}"
BorderThickness="2"
CornerRadius="1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.Styles>
<Style Selector="Button.CalendarHeader">
<Setter Property="Cursor" Value="Hand" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<Style Selector="Button.CalendarHeader:pressed /template/ ContentPresenter">
<Setter Property="Background" Value="Transparent" />
</Style>
<Style Selector="Button.CalendarNavigation">
<Setter Property="Height" Value="20" />
<Setter Property="Width" Value="28" />
</Style>
<Style Selector="Button.CalendarNavigation > Path">
<Setter Property="Fill" Value="{DynamicResource ThemeForegroundBrush}" />
</Style>
<Style Selector="Button.CalendarNavigation:pointerover > Path">
<Setter Property="Fill" Value="{DynamicResource HighlightBrush}" />
</Style>
<Style Selector="Button#HeaderButton:pointerover">
<Setter Property="Foreground" Value="{DynamicResource HighlightBrush}" />
</Style>
</Grid.Styles>
<Rectangle Grid.ColumnSpan="3"
Height="22"
VerticalAlignment="Top"
Fill="{TemplateBinding HeaderBackground}"
Stretch="Fill" />
<Button Name="PreviousButton"
HorizontalAlignment="Left"
Classes="CalendarHeader CalendarNavigation"
IsVisible="False">
<Path Width="6"
Height="10"
Margin="14,-6,0,0"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Data="M288.75,232.25 L288.75,240.625 L283,236.625 z"
Stretch="Fill" />
</Button>
<Button Name="HeaderButton"
Grid.Column="1"
Padding="1,5,1,9"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Classes="CalendarHeader"
FontSize="10.5"
FontWeight="Bold" />
<Button Name="NextButton"
Grid.Column="2"
HorizontalAlignment="Right"
Classes="CalendarHeader CalendarNavigation"
IsVisible="False">
<Path Width="6"
Height="10"
Margin="0,-6,14,0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="M282.875,231.875 L282.875,240.375 L288.625,236 z"
Stretch="Fill" />
</Button>
<Grid Name="MonthView"
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="6,-1,6,6"
IsVisible="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
</Grid>
<Grid Name="YearView"
Grid.Row="1"
Grid.ColumnSpan="3"
Margin="6,-3,7,6"
IsVisible="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
</Grid>
</Grid>
</Border>
</Border>
<Rectangle Name="DisabledVisual"
Margin="0,2,0,2"
Fill="{DynamicResource ThemeControlLowBrush}"
IsVisible="False"
Opacity="{DynamicResource ThemeDisabledOpacity}"
Stretch="Fill" />
</Panel>
</ControlTemplate>
</Setter>
<Setter Property="DayTitleTemplate">
<Template>
<TextBlock Margin="0,4,0,4"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontSize="9.5"
FontWeight="Bold"
Text="{Binding}" />
</Template>
</Setter>
<Style Selector="^:calendardisabled /template/ Rectangle#DisabledVisual">
<Setter Property="IsVisible" Value="True" />
</Style>
</ControlTheme>
</ResourceDictionary>