Readable coloring for calendar events.

This commit is contained in:
Burak Kaan Köse
2024-12-30 01:15:06 +01:00
parent 332f2ab89f
commit bb56815210
2 changed files with 37 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
xmlns:controls="using:Wino.Calendar.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:data="using:Wino.Calendar.ViewModels.Data"
xmlns:helpers="using:Wino.Helpers"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:models="using:Wino.Core.Domain.Models.Calendar"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
@@ -12,9 +13,12 @@
<!-- Default Calendar Item View Model Template -->
<DataTemplate x:Key="CalendarItemViewModelItemTemplate" x:DataType="data:CalendarItemViewModel">
<Grid Background="Red" CornerRadius="4">
<Grid Background="{x:Bind helpers:XamlHelpers.GetSolidColorBrushFromHex(AssignedCalendar.BackgroundColorHex), Mode=OneWay}" CornerRadius="4">
<TextBlock
Margin="2,0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Foreground="{x:Bind helpers:XamlHelpers.GetReadableTextColor(AssignedCalendar.BackgroundColorHex), Mode=OneWay}"
Text="{x:Bind CalendarItem.Title}"
TextWrapping="Wrap" />
</Grid>