Skip to content

Commit 238e4e5

Browse files
committed
Fix event indicators not being visible in Event calendar examples in sample app
1 parent e7a4978 commit 238e4e5

File tree

6 files changed

+37
-14
lines changed

6 files changed

+37
-14
lines changed

XCalendarFormsSample/XCalendarFormsSample/App.xaml

+9
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@
8484
<Setter Property="TextColor" Value="{StaticResource CalendarTertiaryColor}"/>
8585
</Style>
8686

87+
<Style x:Key="DefaultEventIndicatorRectangleStyle" TargetType="{x:Type Rectangle}">
88+
<Setter Property="HeightRequest" Value="8"/>
89+
<Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
90+
<Setter Property="RadiusX" Value="100"/>
91+
<Setter Property="RadiusY" Value="100"/>
92+
<Setter Property="VerticalOptions" Value="Center"/>
93+
<Setter Property="WidthRequest" Value="8"/>
94+
</Style>
95+
8796
<Style x:Key="DefaultPageStyle" TargetType="{x:Type ContentPage}">
8897
<Setter Property="BackgroundColor" Value="{StaticResource PageBackgroundColor}"/>
8998
<Setter Property="xct:SafeAreaEffect.SafeArea" Value="True"/>

XCalendarFormsSample/XCalendarFormsSample/Views/EventCalendarExamplePage.xaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
xmlns:ViewModels="clr-namespace:XCalendarFormsSample.ViewModels"
99
xmlns:xc="clr-namespace:XCalendar.Forms.Views;assembly=XCalendar.Forms"
1010
xmlns:xcConverters="clr-namespace:XCalendar.Forms.Converters;assembly=XCalendar.Forms"
11-
xmlns:xcModels="clr-namespace:XCalendar.Forms.Models;assembly=XCalendar.Forms"
1211
xmlns:xct="http://xamarin.com/schemas/2020/toolkit"
1312
x:Name="This"
1413
Title="Event Calendar"
@@ -94,6 +93,14 @@
9493
IsToday="{Binding IsToday}"
9594
OtherMonthStyle="{StaticResource DefaultDayViewOtherMonthStyle}">
9695

96+
<xc:DayView.EventTemplate>
97+
<DataTemplate x:DataType="{x:Null}">
98+
<Rectangle
99+
Fill="{Binding Color}"
100+
Style="{StaticResource DefaultEventIndicatorRectangleStyle}"/>
101+
</DataTemplate>
102+
</xc:DayView.EventTemplate>
103+
97104
<xc:DayView.CurrentMonthStyle>
98105
<Style BasedOn="{StaticResource DefaultDayViewCurrentMonthStyle}" TargetType="{x:Type xc:DayView}">
99106
<Setter Property="Command" Value="{Binding BindingContext.ChangeDateSelectionCommand, Source={x:Reference This}}"/>

XCalendarFormsSample/XCalendarFormsSample/Views/PlaygroundPage.xaml

+2-6
Original file line numberDiff line numberDiff line change
@@ -1010,14 +1010,10 @@
10101010
<DataTemplate x:DataType="{x:Null}">
10111011
<Rectangle
10121012
Fill="{Binding Color}"
1013-
HeightRequest="8"
1014-
HorizontalOptions="CenterAndExpand"
1015-
RadiusX="100"
1016-
RadiusY="100"
1017-
VerticalOptions="Center"
1018-
WidthRequest="8"/>
1013+
Style="{StaticResource DefaultEventIndicatorRectangleStyle}"/>
10191014
</DataTemplate>
10201015
</xc:DayView.EventTemplate>
1016+
10211017
<xc:DayView.CurrentMonthStyle>
10221018
<Style BasedOn="{StaticResource DefaultDayViewCurrentMonthStyle}" TargetType="{x:Type xc:DayView}">
10231019
<Setter Property="BackgroundColor" Value="{Binding BindingContext.DayCurrentMonthBackgroundColor, Source={x:Reference This}}"/>

XCalendarMauiSample/App.xaml

+9
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,15 @@
8585
<Setter Property="TextColor" Value="{StaticResource CalendarTertiaryColor}"/>
8686
</Style>
8787

88+
<Style x:Key="DefaultEventIndicatorRectangleStyle" TargetType="{x:Type Rectangle}">
89+
<Setter Property="HeightRequest" Value="8"/>
90+
<Setter Property="HorizontalOptions" Value="CenterAndExpand"/>
91+
<Setter Property="RadiusX" Value="100"/>
92+
<Setter Property="RadiusY" Value="100"/>
93+
<Setter Property="VerticalOptions" Value="Center"/>
94+
<Setter Property="WidthRequest" Value="8"/>
95+
</Style>
96+
8897
<Style x:Key="DefaultPageStyle" TargetType="{x:Type ContentPage}">
8998
<Setter Property="BackgroundColor" Value="{StaticResource PageBackgroundColor}"/>
9099
<Setter Property="Shell.BackgroundColor" Value="{StaticResource PrimaryColor}"/>

XCalendarMauiSample/Views/EventCalendarExamplePage.xaml

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
xmlns:mct="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
99
xmlns:xc="clr-namespace:XCalendar.Maui.Views;assembly=XCalendar.Maui"
1010
xmlns:xcConverters="clr-namespace:XCalendar.Maui.Converters;assembly=XCalendar.Maui"
11-
xmlns:xcModels="clr-namespace:XCalendar.Maui.Models;assembly=XCalendar.Maui"
1211
x:Name="This"
1312
Title="Event Calendar"
1413
x:DataType="{x:Type ViewModels:EventCalendarExampleViewModel}"
@@ -94,6 +93,14 @@
9493
IsToday="{Binding IsToday}"
9594
OtherMonthStyle="{StaticResource DefaultDayViewOtherMonthStyle}">
9695

96+
<xc:DayView.EventTemplate>
97+
<DataTemplate x:DataType="{x:Null}">
98+
<Rectangle
99+
Fill="{Binding Color}"
100+
Style="{StaticResource DefaultEventIndicatorRectangleStyle}"/>
101+
</DataTemplate>
102+
</xc:DayView.EventTemplate>
103+
97104
<xc:DayView.CurrentMonthStyle>
98105
<Style BasedOn="{StaticResource DefaultDayViewCurrentMonthStyle}" TargetType="{x:Type xc:DayView}">
99106
<Setter Property="Command" Value="{Binding BindingContext.ChangeDateSelectionCommand, Source={x:Reference This}}"/>

XCalendarMauiSample/Views/PlaygroundPage.xaml

+1-6
Original file line numberDiff line numberDiff line change
@@ -1051,12 +1051,7 @@
10511051
<DataTemplate x:DataType="{x:Null}">
10521052
<Rectangle
10531053
Fill="{Binding Color}"
1054-
HeightRequest="8"
1055-
HorizontalOptions="CenterAndExpand"
1056-
RadiusX="100"
1057-
RadiusY="100"
1058-
VerticalOptions="Center"
1059-
WidthRequest="8"/>
1054+
Style="{StaticResource DefaultEventIndicatorRectangleStyle}"/>
10601055
</DataTemplate>
10611056
</xc:DayView.EventTemplate>
10621057

0 commit comments

Comments
 (0)