2024-12-31 19:21:07 +01:00
|
|
|
<UserControl
|
|
|
|
|
x:Class="Wino.Calendar.Controls.CalendarItemControl"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
|
xmlns:helpers="using:Wino.Helpers"
|
|
|
|
|
xmlns:local="using:Wino.Calendar.Controls"
|
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
|
d:DesignHeight="300"
|
|
|
|
|
d:DesignWidth="400"
|
|
|
|
|
mc:Ignorable="d">
|
|
|
|
|
|
|
|
|
|
<Grid
|
|
|
|
|
x:Name="MainGrid"
|
|
|
|
|
BorderBrush="{ThemeResource CalendarSeperatorBrush}"
|
|
|
|
|
BorderThickness="1"
|
|
|
|
|
CornerRadius="6">
|
|
|
|
|
<Grid x:Name="MainBackground" Background="{x:Bind helpers:XamlHelpers.GetSolidColorBrushFromHex(CalendarItem.AssignedCalendar.BackgroundColorHex), Mode=OneWay}" />
|
|
|
|
|
<TextBlock
|
|
|
|
|
x:Name="EventTitleTextblock"
|
|
|
|
|
Margin="2,0"
|
|
|
|
|
HorizontalAlignment="Center"
|
|
|
|
|
VerticalAlignment="Center"
|
2025-01-01 17:28:29 +01:00
|
|
|
CharacterSpacing="8"
|
|
|
|
|
FontSize="13"
|
|
|
|
|
FontWeight="SemiBold"
|
2024-12-31 19:21:07 +01:00
|
|
|
Foreground="{x:Bind helpers:XamlHelpers.GetReadableTextColor(CalendarItem.AssignedCalendar.BackgroundColorHex), Mode=OneWay}"
|
|
|
|
|
Text="{x:Bind CalendarItem.Title}"
|
|
|
|
|
TextWrapping="Wrap" />
|
|
|
|
|
|
|
|
|
|
<VisualStateManager.VisualStateGroups>
|
|
|
|
|
<VisualStateGroup x:Name="EventDurationStates">
|
|
|
|
|
<VisualState x:Name="RegularEvent" />
|
|
|
|
|
<VisualState x:Name="AllDayEvent">
|
|
|
|
|
<VisualState.Setters>
|
|
|
|
|
<Setter Target="MainGrid.MinHeight" Value="25" />
|
|
|
|
|
<Setter Target="EventTitleTextblock.Margin" Value="6,0" />
|
|
|
|
|
</VisualState.Setters>
|
|
|
|
|
</VisualState>
|
|
|
|
|
|
|
|
|
|
<VisualState x:Name="MultiDayEvent">
|
|
|
|
|
<VisualState.Setters>
|
|
|
|
|
<Setter Target="MainBackground.Opacity" Value="0.6" />
|
|
|
|
|
<Setter Target="MainGrid.CornerRadius" Value="0" />
|
|
|
|
|
<Setter Target="MainGrid.BorderThickness" Value="0.5" />
|
|
|
|
|
</VisualState.Setters>
|
|
|
|
|
</VisualState>
|
|
|
|
|
</VisualStateGroup>
|
|
|
|
|
</VisualStateManager.VisualStateGroups>
|
|
|
|
|
</Grid>
|
|
|
|
|
</UserControl>
|