Fixed the display date of the calendar items. Created test project for core library, included tests for recurring calendar events.

This commit is contained in:
Burak Kaan Köse
2025-12-29 14:10:09 +01:00
parent f79305f0a6
commit 8613e92b31
33 changed files with 1168 additions and 173 deletions
@@ -3,4 +3,10 @@ using Wino.Mail.WinUI;
namespace Wino.Calendar.Views.Abstract;
public abstract class CalendarPageAbstract : BasePage<CalendarPageViewModel> { }
public abstract class CalendarPageAbstract : BasePage<CalendarPageViewModel>
{
protected CalendarPageAbstract()
{
NavigationCacheMode = Microsoft.UI.Xaml.Navigation.NavigationCacheMode.Enabled;
}
}
@@ -156,6 +156,7 @@
<calendarControls:WinoCalendarView
x:Name="CalendarView"
Grid.Row="0"
Margin="0,12,0,0"
HorizontalAlignment="Center"
DateClickedCommand="{x:Bind ViewModel.DateClickedCommand}"
HighlightedDateRange="{x:Bind ViewModel.HighlightedDateRange, Mode=OneWay}"
@@ -18,9 +18,9 @@
<Page.Resources>
<CollectionViewSource
x:Key="GroupedCalendarEnumerableViewSource"
x:Name="GroupedCalendarEnumerableViewSource"
IsSourceGrouped="True"
Source="{x:Bind ViewModel.AccountCalendarStateService.GroupedAccountCalendarsEnumerable, Mode=OneWay}" />
Source="{x:Bind ViewModel.AccountCalendarStateService.GroupedAccountCalendars, Mode=OneWay}" />
</Page.Resources>
<Border
@@ -124,7 +124,7 @@
<ListView
MaxHeight="300"
HorizontalAlignment="Stretch"
ItemsSource="{Binding Source={StaticResource GroupedCalendarEnumerableViewSource}}"
ItemsSource="{x:Bind GroupedCalendarEnumerableViewSource.View, Mode=OneWay}"
SelectedItem="{x:Bind ViewModel.SelectedQuickEventAccountCalendar, Mode=TwoWay}"
SelectionChanged="QuickEventAccountSelectorSelectionChanged">
<ListView.ItemTemplate>
@@ -22,7 +22,6 @@ public sealed partial class CalendarPage : CalendarPageAbstract,
public CalendarPage()
{
InitializeComponent();
NavigationCacheMode = NavigationCacheMode.Enabled;
ViewModel.DetailsShowCalendarItemChanged += CalendarItemDetailContextChanged;
}
@@ -40,6 +39,26 @@ public sealed partial class CalendarPage : CalendarPageAbstract,
}
}
protected override void RegisterRecipients()
{
base.RegisterRecipients();
WeakReferenceMessenger.Default.Register<ScrollToDateMessage>(this);
WeakReferenceMessenger.Default.Register<ScrollToHourMessage>(this);
WeakReferenceMessenger.Default.Register<GoNextDateRequestedMessage>(this);
WeakReferenceMessenger.Default.Register<GoPreviousDateRequestedMessage>(this);
}
protected override void UnregisterRecipients()
{
base.UnregisterRecipients();
WeakReferenceMessenger.Default.Unregister<ScrollToDateMessage>(this);
WeakReferenceMessenger.Default.Unregister<ScrollToHourMessage>(this);
WeakReferenceMessenger.Default.Unregister<GoNextDateRequestedMessage>(this);
WeakReferenceMessenger.Default.Unregister<GoPreviousDateRequestedMessage>(this);
}
public void Receive(ScrollToHourMessage message) => CalendarControl.NavigateToHour(message.TimeSpan);
public void Receive(ScrollToDateMessage message) => CalendarControl.NavigateToDay(message.Date);
public void Receive(GoNextDateRequestedMessage message) => CalendarControl.GoNextRange();