diff --git a/Wino.Calendar/Activation/DefaultActivationHandler.cs b/Wino.Calendar/Activation/DefaultActivationHandler.cs deleted file mode 100644 index e2d1b8f7..00000000 --- a/Wino.Calendar/Activation/DefaultActivationHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Threading.Tasks; -using Windows.ApplicationModel.Activation; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media.Animation; -using Wino.Activation; -using Wino.Calendar.Views; - -namespace Wino.Calendar.Activation; - -public class DefaultActivationHandler : ActivationHandler -{ - protected override Task HandleInternalAsync(IActivatedEventArgs args) - { - (Window.Current.Content as Frame).Navigate(typeof(AppShell), null, new DrillInNavigationTransitionInfo()); - - return Task.CompletedTask; - } - - // Only navigate if Frame content doesn't exist. - protected override bool CanHandleInternal(IActivatedEventArgs args) - => (Window.Current?.Content as Frame)?.Content == null; -} diff --git a/Wino.Calendar/App.xaml b/Wino.Calendar/App.xaml deleted file mode 100644 index 1b0db3ef..00000000 --- a/Wino.Calendar/App.xaml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/App.xaml.cs b/Wino.Calendar/App.xaml.cs deleted file mode 100644 index 6e2da4ce..00000000 --- a/Wino.Calendar/App.xaml.cs +++ /dev/null @@ -1,145 +0,0 @@ -using System; -using System.Collections.Generic; -using CommunityToolkit.Mvvm.Messaging; -using Microsoft.Extensions.DependencyInjection; -using Serilog; -using Windows.ApplicationModel; -using Windows.ApplicationModel.Activation; -using Windows.ApplicationModel.AppService; -using Windows.ApplicationModel.Background; -using Windows.UI.Core.Preview; -using Wino.Activation; -using Wino.Calendar.Activation; -using Wino.Calendar.Services; -using Wino.Calendar.ViewModels; -using Wino.Calendar.ViewModels.Interfaces; -using Wino.Core.Domain; -using Wino.Core.Domain.Enums; -using Wino.Core.Domain.Exceptions; -using Wino.Core.Domain.Interfaces; -using Wino.Core.Domain.Models.Synchronization; -using Wino.Core.UWP; -using Wino.Core.ViewModels; -using Wino.Messaging.Client.Connection; -using Wino.Messaging.Server; -using Wino.Services; - -namespace Wino.Calendar; - -public sealed partial class App : WinoApplication, IRecipient -{ - private BackgroundTaskDeferral connectionBackgroundTaskDeferral; - - public App() - { - InitializeComponent(); - WeakReferenceMessenger.Default.Register(this); - } - - public override IServiceProvider ConfigureServices() - { - var services = new ServiceCollection(); - - services.RegisterSharedServices(); - services.RegisterCalendarViewModelServices(); - services.RegisterCoreUWPServices(); - services.RegisterCoreViewModels(); - - RegisterUWPServices(services); - RegisterViewModels(services); - RegisterActivationHandlers(services); - - return services.BuildServiceProvider(); - } - - #region Dependency Injection - - private void RegisterActivationHandlers(IServiceCollection services) - { - //services.AddTransient(); - //services.AddTransient(); - //services.AddTransient(); - } - - private void RegisterUWPServices(IServiceCollection services) - { - services.AddSingleton(); - services.AddSingleton(); - services.AddTransient(); - services.AddSingleton(); - services.AddSingleton(); - } - - private void RegisterViewModels(IServiceCollection services) - { - services.AddSingleton(typeof(AppShellViewModel)); - services.AddSingleton(typeof(CalendarPageViewModel)); - services.AddTransient(typeof(CalendarSettingsPageViewModel)); - services.AddTransient(typeof(AccountManagementViewModel)); - services.AddTransient(typeof(PersonalizationPageViewModel)); - services.AddTransient(typeof(AccountDetailsPageViewModel)); - services.AddTransient(typeof(EventDetailsPageViewModel)); - } - - #endregion - - protected override void OnApplicationCloseRequested(object sender, SystemNavigationCloseRequestedPreviewEventArgs e) - { - // TODO: Check server running. - } - - protected override async void OnLaunched(LaunchActivatedEventArgs args) - { - LogActivation($"OnLaunched -> {args.GetType().Name}, Kind -> {args.Kind}, PreviousExecutionState -> {args.PreviousExecutionState}, IsPrelaunch -> {args.PrelaunchActivated}"); - - if (!args.PrelaunchActivated) - { - await ActivateWinoAsync(args); - } - } - - protected override IEnumerable GetActivationHandlers() - { - return null; - } - - protected override ActivationHandler GetDefaultActivationHandler() - => new DefaultActivationHandler(); - - protected override void OnBackgroundActivated(BackgroundActivatedEventArgs args) - { - base.OnBackgroundActivated(args); - - if (args.TaskInstance.TriggerDetails is AppServiceTriggerDetails appServiceTriggerDetails) - { - LogActivation("OnBackgroundActivated -> AppServiceTriggerDetails received."); - - // Only accept connections from callers in the same package - if (appServiceTriggerDetails.CallerPackageFamilyName == Package.Current.Id.FamilyName) - { - // Connection established from the fulltrust process - // This is no longer needed with the empty connection manager implementation - - connectionBackgroundTaskDeferral = args.TaskInstance.GetDeferral(); - args.TaskInstance.Canceled += OnConnectionBackgroundTaskCanceled; - } - } - } - - public void OnConnectionBackgroundTaskCanceled(IBackgroundTaskInstance sender, BackgroundTaskCancellationReason reason) - { - sender.Canceled -= OnConnectionBackgroundTaskCanceled; - - Log.Information($"Server connection background task was canceled. Reason: {reason}"); - - connectionBackgroundTaskDeferral?.Complete(); - connectionBackgroundTaskDeferral = null; - } - - public async void Receive(NewCalendarSynchronizationRequested message) - { - // Synchronization is no longer performed through the server connection manager - // This method is kept for compatibility but doesn't perform any actual work - await Task.CompletedTask; - } -} diff --git a/Wino.Calendar/Args/TimelineCellSelectedArgs.cs b/Wino.Calendar/Args/TimelineCellSelectedArgs.cs deleted file mode 100644 index 481e0182..00000000 --- a/Wino.Calendar/Args/TimelineCellSelectedArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Windows.Foundation; - -namespace Wino.Calendar.Args; - -/// -/// When a new timeline cell is selected. -/// -public class TimelineCellSelectedArgs : EventArgs -{ - public TimelineCellSelectedArgs(DateTime clickedDate, Point canvasPoint, Point positionerPoint, Size cellSize) - { - ClickedDate = clickedDate; - CanvasPoint = canvasPoint; - PositionerPoint = positionerPoint; - CellSize = cellSize; - } - - /// - /// Clicked date and time information for the cell. - /// - public DateTime ClickedDate { get; set; } - - /// - /// Position relative to the cell drawing part of the canvas. - /// Used to detect clicked cell from the position. - /// - public Point CanvasPoint { get; } - - /// - /// Position relative to the main root positioner element of the drawing canvas. - /// Used to show the create event dialog teaching tip in correct position. - /// - public Point PositionerPoint { get; } - - /// - /// Size of the cell. - /// - public Size CellSize { get; } -} diff --git a/Wino.Calendar/Args/TimelineCellUnselectedArgs.cs b/Wino.Calendar/Args/TimelineCellUnselectedArgs.cs deleted file mode 100644 index 7cbeb841..00000000 --- a/Wino.Calendar/Args/TimelineCellUnselectedArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using System; - -namespace Wino.Calendar.Args; - -/// -/// When selected timeline cell is unselected. -/// -public class TimelineCellUnselectedArgs : EventArgs { } diff --git a/Wino.Calendar/Assets/LargeTile.scale-100.png b/Wino.Calendar/Assets/LargeTile.scale-100.png deleted file mode 100644 index 42334872..00000000 Binary files a/Wino.Calendar/Assets/LargeTile.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/LargeTile.scale-125.png b/Wino.Calendar/Assets/LargeTile.scale-125.png deleted file mode 100644 index 9c03a75c..00000000 Binary files a/Wino.Calendar/Assets/LargeTile.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/LargeTile.scale-150.png b/Wino.Calendar/Assets/LargeTile.scale-150.png deleted file mode 100644 index e29aa6e0..00000000 Binary files a/Wino.Calendar/Assets/LargeTile.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/LargeTile.scale-200.png b/Wino.Calendar/Assets/LargeTile.scale-200.png deleted file mode 100644 index 5ad11086..00000000 Binary files a/Wino.Calendar/Assets/LargeTile.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/LargeTile.scale-400.png b/Wino.Calendar/Assets/LargeTile.scale-400.png deleted file mode 100644 index af446cf4..00000000 Binary files a/Wino.Calendar/Assets/LargeTile.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Assets/LockScreenLogo.scale-200.png b/Wino.Calendar/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 735f57ad..00000000 Binary files a/Wino.Calendar/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SmallTile.scale-100.png b/Wino.Calendar/Assets/SmallTile.scale-100.png deleted file mode 100644 index 2d1167f7..00000000 Binary files a/Wino.Calendar/Assets/SmallTile.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SmallTile.scale-125.png b/Wino.Calendar/Assets/SmallTile.scale-125.png deleted file mode 100644 index d8bc11c5..00000000 Binary files a/Wino.Calendar/Assets/SmallTile.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SmallTile.scale-150.png b/Wino.Calendar/Assets/SmallTile.scale-150.png deleted file mode 100644 index e124da41..00000000 Binary files a/Wino.Calendar/Assets/SmallTile.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SmallTile.scale-200.png b/Wino.Calendar/Assets/SmallTile.scale-200.png deleted file mode 100644 index 3854c86c..00000000 Binary files a/Wino.Calendar/Assets/SmallTile.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SmallTile.scale-400.png b/Wino.Calendar/Assets/SmallTile.scale-400.png deleted file mode 100644 index f242a580..00000000 Binary files a/Wino.Calendar/Assets/SmallTile.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SplashScreen.scale-100.png b/Wino.Calendar/Assets/SplashScreen.scale-100.png deleted file mode 100644 index 86ade338..00000000 Binary files a/Wino.Calendar/Assets/SplashScreen.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SplashScreen.scale-125.png b/Wino.Calendar/Assets/SplashScreen.scale-125.png deleted file mode 100644 index 55d0473d..00000000 Binary files a/Wino.Calendar/Assets/SplashScreen.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SplashScreen.scale-150.png b/Wino.Calendar/Assets/SplashScreen.scale-150.png deleted file mode 100644 index 80b9ed0d..00000000 Binary files a/Wino.Calendar/Assets/SplashScreen.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SplashScreen.scale-200.png b/Wino.Calendar/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 8510c90c..00000000 Binary files a/Wino.Calendar/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/SplashScreen.scale-400.png b/Wino.Calendar/Assets/SplashScreen.scale-400.png deleted file mode 100644 index 7efc715b..00000000 Binary files a/Wino.Calendar/Assets/SplashScreen.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square150x150Logo.scale-100.png b/Wino.Calendar/Assets/Square150x150Logo.scale-100.png deleted file mode 100644 index 37501fe7..00000000 Binary files a/Wino.Calendar/Assets/Square150x150Logo.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square150x150Logo.scale-125.png b/Wino.Calendar/Assets/Square150x150Logo.scale-125.png deleted file mode 100644 index 0622878d..00000000 Binary files a/Wino.Calendar/Assets/Square150x150Logo.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square150x150Logo.scale-150.png b/Wino.Calendar/Assets/Square150x150Logo.scale-150.png deleted file mode 100644 index 15dc07b5..00000000 Binary files a/Wino.Calendar/Assets/Square150x150Logo.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square150x150Logo.scale-200.png b/Wino.Calendar/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 75c9945a..00000000 Binary files a/Wino.Calendar/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square150x150Logo.scale-400.png b/Wino.Calendar/Assets/Square150x150Logo.scale-400.png deleted file mode 100644 index cb218b68..00000000 Binary files a/Wino.Calendar/Assets/Square150x150Logo.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png b/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png deleted file mode 100644 index 2c72b37d..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png b/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png deleted file mode 100644 index 895753c9..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png b/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png deleted file mode 100644 index eeaaad33..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png deleted file mode 100644 index e7c0cb66..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png b/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png deleted file mode 100644 index 56792258..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-16.png deleted file mode 100644 index 2c72b37d..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-16.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-256.png deleted file mode 100644 index eeaaad33..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-256.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-32.png deleted file mode 100644 index e7c0cb66..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-32.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-48.png deleted file mode 100644 index 56792258..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.altform-unplated_targetsize-48.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.scale-100.png b/Wino.Calendar/Assets/Square44x44Logo.scale-100.png deleted file mode 100644 index 43b04c94..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.scale-125.png b/Wino.Calendar/Assets/Square44x44Logo.scale-125.png deleted file mode 100644 index c6ca31f5..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.scale-150.png b/Wino.Calendar/Assets/Square44x44Logo.scale-150.png deleted file mode 100644 index 97bf5eb8..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.scale-200.png b/Wino.Calendar/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f1a2ddef..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.scale-400.png b/Wino.Calendar/Assets/Square44x44Logo.scale-400.png deleted file mode 100644 index b25cb5bc..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.targetsize-16.png b/Wino.Calendar/Assets/Square44x44Logo.targetsize-16.png deleted file mode 100644 index 22a4ac74..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.targetsize-16.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.targetsize-24.png b/Wino.Calendar/Assets/Square44x44Logo.targetsize-24.png deleted file mode 100644 index ac5a485d..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.targetsize-24.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/Wino.Calendar/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index 895753c9..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.targetsize-256.png b/Wino.Calendar/Assets/Square44x44Logo.targetsize-256.png deleted file mode 100644 index 9e6a53b2..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.targetsize-256.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.targetsize-32.png b/Wino.Calendar/Assets/Square44x44Logo.targetsize-32.png deleted file mode 100644 index 79388f0d..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.targetsize-32.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Square44x44Logo.targetsize-48.png b/Wino.Calendar/Assets/Square44x44Logo.targetsize-48.png deleted file mode 100644 index 47aea727..00000000 Binary files a/Wino.Calendar/Assets/Square44x44Logo.targetsize-48.png and /dev/null differ diff --git a/Wino.Calendar/Assets/StoreLogo.backup.png b/Wino.Calendar/Assets/StoreLogo.backup.png deleted file mode 100644 index 7385b56c..00000000 Binary files a/Wino.Calendar/Assets/StoreLogo.backup.png and /dev/null differ diff --git a/Wino.Calendar/Assets/StoreLogo.scale-100.png b/Wino.Calendar/Assets/StoreLogo.scale-100.png deleted file mode 100644 index caafaee8..00000000 Binary files a/Wino.Calendar/Assets/StoreLogo.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/StoreLogo.scale-125.png b/Wino.Calendar/Assets/StoreLogo.scale-125.png deleted file mode 100644 index 59f77d4e..00000000 Binary files a/Wino.Calendar/Assets/StoreLogo.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/StoreLogo.scale-150.png b/Wino.Calendar/Assets/StoreLogo.scale-150.png deleted file mode 100644 index 6adf5536..00000000 Binary files a/Wino.Calendar/Assets/StoreLogo.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/StoreLogo.scale-200.png b/Wino.Calendar/Assets/StoreLogo.scale-200.png deleted file mode 100644 index b4b471f8..00000000 Binary files a/Wino.Calendar/Assets/StoreLogo.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/StoreLogo.scale-400.png b/Wino.Calendar/Assets/StoreLogo.scale-400.png deleted file mode 100644 index be94d352..00000000 Binary files a/Wino.Calendar/Assets/StoreLogo.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Wide310x150Logo.scale-100.png b/Wino.Calendar/Assets/Wide310x150Logo.scale-100.png deleted file mode 100644 index 0847e264..00000000 Binary files a/Wino.Calendar/Assets/Wide310x150Logo.scale-100.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Wide310x150Logo.scale-125.png b/Wino.Calendar/Assets/Wide310x150Logo.scale-125.png deleted file mode 100644 index 0be7583f..00000000 Binary files a/Wino.Calendar/Assets/Wide310x150Logo.scale-125.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Wide310x150Logo.scale-150.png b/Wino.Calendar/Assets/Wide310x150Logo.scale-150.png deleted file mode 100644 index f969318f..00000000 Binary files a/Wino.Calendar/Assets/Wide310x150Logo.scale-150.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Wide310x150Logo.scale-200.png b/Wino.Calendar/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 86ade338..00000000 Binary files a/Wino.Calendar/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/Wino.Calendar/Assets/Wide310x150Logo.scale-400.png b/Wino.Calendar/Assets/Wide310x150Logo.scale-400.png deleted file mode 100644 index 8510c90c..00000000 Binary files a/Wino.Calendar/Assets/Wide310x150Logo.scale-400.png and /dev/null differ diff --git a/Wino.Calendar/Controls/CalendarItemCommandBarFlyout.cs b/Wino.Calendar/Controls/CalendarItemCommandBarFlyout.cs deleted file mode 100644 index 407a9ed5..00000000 --- a/Wino.Calendar/Controls/CalendarItemCommandBarFlyout.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Microsoft.UI.Xaml.Controls; -using Windows.UI.Xaml; -using Wino.Calendar.ViewModels.Data; - -namespace Wino.Calendar.Controls; - -public partial class CalendarItemCommandBarFlyout : CommandBarFlyout -{ - public static readonly DependencyProperty ItemProperty = DependencyProperty.Register(nameof(Item), typeof(CalendarItemViewModel), typeof(CalendarItemCommandBarFlyout), new PropertyMetadata(null, new PropertyChangedCallback(OnItemChanged))); - - public CalendarItemViewModel Item - { - get { return (CalendarItemViewModel)GetValue(ItemProperty); } - set { SetValue(ItemProperty, value); } - } - - - private static void OnItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is CalendarItemCommandBarFlyout flyout) - { - flyout.UpdateMenuItems(); - } - } - - private void UpdateMenuItems() - { - - } -} diff --git a/Wino.Calendar/Controls/CalendarItemControl.xaml b/Wino.Calendar/Controls/CalendarItemControl.xaml deleted file mode 100644 index abfc1766..00000000 --- a/Wino.Calendar/Controls/CalendarItemControl.xaml +++ /dev/null @@ -1,160 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Controls/CalendarItemControl.xaml.cs b/Wino.Calendar/Controls/CalendarItemControl.xaml.cs deleted file mode 100644 index dbd2333b..00000000 --- a/Wino.Calendar/Controls/CalendarItemControl.xaml.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System.Threading.Tasks; -using CommunityToolkit.Mvvm.Messaging; -using Itenso.TimePeriod; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Input; -using Wino.Calendar.ViewModels.Data; -using Wino.Calendar.ViewModels.Messages; -using Wino.Core.Domain; -using Wino.Core.Domain.Models.Calendar; - -namespace Wino.Calendar.Controls; - -public sealed partial class CalendarItemControl : UserControl -{ - // Single tap has a delay to report double taps properly. - private bool isSingleTap = false; - - public static readonly DependencyProperty CalendarItemProperty = DependencyProperty.Register(nameof(CalendarItem), typeof(CalendarItemViewModel), typeof(CalendarItemControl), new PropertyMetadata(null, new PropertyChangedCallback(OnCalendarItemChanged))); - public static readonly DependencyProperty IsDraggingProperty = DependencyProperty.Register(nameof(IsDragging), typeof(bool), typeof(CalendarItemControl), new PropertyMetadata(false)); - public static readonly DependencyProperty IsCustomEventAreaProperty = DependencyProperty.Register(nameof(IsCustomEventArea), typeof(bool), typeof(CalendarItemControl), new PropertyMetadata(false)); - public static readonly DependencyProperty CalendarItemTitleProperty = DependencyProperty.Register(nameof(CalendarItemTitle), typeof(string), typeof(CalendarItemControl), new PropertyMetadata(string.Empty)); - public static readonly DependencyProperty DisplayingDateProperty = DependencyProperty.Register(nameof(DisplayingDate), typeof(CalendarDayModel), typeof(CalendarItemControl), new PropertyMetadata(null, new PropertyChangedCallback(OnDisplayDateChanged))); - - /// - /// Whether the control is displaying as regular event or all-multi day area in the day control. - /// - public bool IsCustomEventArea - { - get { return (bool)GetValue(IsCustomEventAreaProperty); } - set { SetValue(IsCustomEventAreaProperty, value); } - } - - /// - /// Day that the calendar item is rendered at. - /// It's needed for title manipulation and some other adjustments later on. - /// - public CalendarDayModel DisplayingDate - { - get { return (CalendarDayModel)GetValue(DisplayingDateProperty); } - set { SetValue(DisplayingDateProperty, value); } - } - - public string CalendarItemTitle - { - get { return (string)GetValue(CalendarItemTitleProperty); } - set { SetValue(CalendarItemTitleProperty, value); } - } - - public CalendarItemViewModel CalendarItem - { - get { return (CalendarItemViewModel)GetValue(CalendarItemProperty); } - set { SetValue(CalendarItemProperty, value); } - } - - public bool IsDragging - { - get { return (bool)GetValue(IsDraggingProperty); } - set { SetValue(IsDraggingProperty, value); } - } - - public CalendarItemControl() - { - InitializeComponent(); - } - - private static void OnDisplayDateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is CalendarItemControl control) - { - control.UpdateControlVisuals(); - } - } - - private static void OnCalendarItemChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is CalendarItemControl control) - { - control.UpdateControlVisuals(); - } - } - - private void UpdateControlVisuals() - { - // Depending on the calendar item's duration and attributes, we might need to change the display title. - // 1. Multi-Day events should display the start date and end date. - // 2. Multi-Day events that occupy the whole day just shows 'all day'. - // 3. Other events should display the title. - - if (CalendarItem == null) return; - if (DisplayingDate == null) return; - - if (CalendarItem.IsMultiDayEvent) - { - // Multi day events are divided into 3 categories: - // 1. All day events - // 2. Events that started after the period. - // 3. Events that started before the period and finishes within the period. - - var periodRelation = CalendarItem.Period.GetRelation(DisplayingDate.Period); - - if (periodRelation == Itenso.TimePeriod.PeriodRelation.StartInside || - periodRelation == PeriodRelation.EnclosingStartTouching) - { - // hour -> title - CalendarItemTitle = $"{DisplayingDate.CalendarRenderOptions.CalendarSettings.GetTimeString(CalendarItem.StartDate.TimeOfDay)} -> {CalendarItem.Title}"; - } - else if ( - periodRelation == PeriodRelation.EndInside || - periodRelation == PeriodRelation.EnclosingEndTouching) - { - // title <- hour - CalendarItemTitle = $"{CalendarItem.Title} <- {DisplayingDate.CalendarRenderOptions.CalendarSettings.GetTimeString(CalendarItem.EndDate.TimeOfDay)}"; - } - else if (periodRelation == PeriodRelation.Enclosing) - { - // This event goes all day and it's multi-day. - // Item must be hidden in the calendar but displayed on the custom area at the top. - - CalendarItemTitle = $"{Translator.CalendarItemAllDay} {CalendarItem.Title}"; - } - else - { - // Not expected, but there it is. - CalendarItemTitle = CalendarItem.Title; - } - - // Debug.WriteLine($"{CalendarItem.Title} Period relation with {DisplayingDate.Period.ToString()}: {periodRelation}"); - } - else - { - CalendarItemTitle = CalendarItem.Title; - } - - UpdateVisualStates(); - } - - private void UpdateVisualStates() - { - if (CalendarItem == null) return; - - if (CalendarItem.IsAllDayEvent) - { - VisualStateManager.GoToState(this, "AllDayEvent", true); - } - else if (CalendarItem.IsMultiDayEvent) - { - if (IsCustomEventArea) - { - VisualStateManager.GoToState(this, "CustomAreaMultiDayEvent", true); - } - else - { - // Hide it. - VisualStateManager.GoToState(this, "MultiDayEvent", true); - } - } - else - { - VisualStateManager.GoToState(this, "RegularEvent", true); - } - } - - private void ControlDragStarting(UIElement sender, DragStartingEventArgs args) => IsDragging = true; - - private void ControlDropped(UIElement sender, DropCompletedEventArgs args) => IsDragging = false; - - private async void ControlTapped(object sender, TappedRoutedEventArgs e) - { - if (CalendarItem == null) return; - - isSingleTap = true; - - await Task.Delay(100); - - if (isSingleTap) - { - WeakReferenceMessenger.Default.Send(new CalendarItemTappedMessage(CalendarItem, DisplayingDate)); - } - } - - private void ControlDoubleTapped(object sender, DoubleTappedRoutedEventArgs e) - { - if (CalendarItem == null) return; - - isSingleTap = false; - - WeakReferenceMessenger.Default.Send(new CalendarItemDoubleTappedMessage(CalendarItem)); - } - - private void ControlRightTapped(object sender, RightTappedRoutedEventArgs e) - { - if (CalendarItem == null) return; - - WeakReferenceMessenger.Default.Send(new CalendarItemRightTappedMessage(CalendarItem)); - } -} diff --git a/Wino.Calendar/Controls/CustomCalendarFlipView.cs b/Wino.Calendar/Controls/CustomCalendarFlipView.cs deleted file mode 100644 index 40b161a0..00000000 --- a/Wino.Calendar/Controls/CustomCalendarFlipView.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Windows.UI.Xaml; -using Windows.UI.Xaml.Automation.Peers; -using Windows.UI.Xaml.Controls; -using Wino.Core.Domain.Enums; - -namespace Wino.Calendar.Controls; - -/// -/// FlipView that hides the navigation buttons and exposes methods to navigate to the next and previous items with animations. -/// -public partial class CustomCalendarFlipView : FlipView -{ - private const string PART_PreviousButtonHorizontal = "PreviousButtonHorizontal"; - private const string PART_NextButtonHorizontal = "NextButtonHorizontal"; - private const string PART_PreviousButtonVertical = "PreviousButtonVertical"; - private const string PART_NextButtonVertical = "NextButtonVertical"; - - public static readonly DependencyProperty DisplayTypeProperty = DependencyProperty.Register( - nameof(DisplayType), - typeof(CalendarDisplayType), - typeof(CustomCalendarFlipView), - new PropertyMetadata(CalendarDisplayType.Week)); - - public CalendarDisplayType DisplayType - { - get => (CalendarDisplayType)GetValue(DisplayTypeProperty); - set => SetValue(DisplayTypeProperty, value); - } - - private Button PreviousButtonHorizontal; - private Button NextButtonHorizontal; - private Button PreviousButtonVertical; - private Button NextButtonVertical; - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - PreviousButtonHorizontal = GetTemplateChild(PART_PreviousButtonHorizontal) as Button; - NextButtonHorizontal = GetTemplateChild(PART_NextButtonHorizontal) as Button; - PreviousButtonVertical = GetTemplateChild(PART_PreviousButtonVertical) as Button; - NextButtonVertical = GetTemplateChild(PART_NextButtonVertical) as Button; - - // Hide navigation buttons - HideButton(PreviousButtonHorizontal); - HideButton(NextButtonHorizontal); - HideButton(PreviousButtonVertical); - HideButton(NextButtonVertical); - } - - private static void HideButton(Button button) - { - if (button == null) return; - - button.Opacity = 0; - button.IsHitTestVisible = false; - } - - public void GoPreviousFlip() - { - var previousButton = DisplayType == CalendarDisplayType.Month - ? PreviousButtonVertical ?? PreviousButtonHorizontal - : PreviousButtonHorizontal ?? PreviousButtonVertical; - - if (previousButton == null) return; - - var backPeer = new ButtonAutomationPeer(previousButton); - backPeer.Invoke(); - } - - public void GoNextFlip() - { - var nextButton = DisplayType == CalendarDisplayType.Month - ? NextButtonVertical ?? NextButtonHorizontal - : NextButtonHorizontal ?? NextButtonVertical; - - if (nextButton == null) return; - - var nextPeer = new ButtonAutomationPeer(nextButton); - nextPeer.Invoke(); - } -} diff --git a/Wino.Calendar/Controls/DayColumnControl.cs b/Wino.Calendar/Controls/DayColumnControl.cs deleted file mode 100644 index 7293886e..00000000 --- a/Wino.Calendar/Controls/DayColumnControl.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Linq; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Core.Domain.Collections; -using Wino.Core.Domain.Models.Calendar; - -namespace Wino.Calendar.Controls; - -public partial class DayColumnControl : Control -{ - private const string PART_HeaderDateDayText = nameof(PART_HeaderDateDayText); - private const string PART_IsTodayBorder = nameof(PART_IsTodayBorder); - private const string PART_ColumnHeaderText = nameof(PART_ColumnHeaderText); - private const string PART_AllDayItemsControl = nameof(PART_AllDayItemsControl); - - private const string TodayState = nameof(TodayState); - private const string NotTodayState = nameof(NotTodayState); - - private TextBlock HeaderDateDayText; - private TextBlock ColumnHeaderText; - private Border IsTodayBorder; - private ItemsControl AllDayItemsControl; - private CalendarEventCollection _boundEventsCollection; - - public CalendarDayModel DayModel - { - get { return (CalendarDayModel)GetValue(DayModelProperty); } - set { SetValue(DayModelProperty, value); } - } - - public static readonly DependencyProperty DayModelProperty = DependencyProperty.Register( - nameof(DayModel), - typeof(CalendarDayModel), - typeof(DayColumnControl), - new PropertyMetadata(null, new PropertyChangedCallback(OnRenderingPropertiesChanged))); - - public DayColumnControl() - { - DefaultStyleKey = typeof(DayColumnControl); - Unloaded += OnUnloaded; - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - HeaderDateDayText = GetTemplateChild(PART_HeaderDateDayText) as TextBlock; - ColumnHeaderText = GetTemplateChild(PART_ColumnHeaderText) as TextBlock; - IsTodayBorder = GetTemplateChild(PART_IsTodayBorder) as Border; - AllDayItemsControl = GetTemplateChild(PART_AllDayItemsControl) as ItemsControl; - - RegisterEventsCollectionHandlers(); - UpdateValues(); - } - - private static void OnRenderingPropertiesChanged(DependencyObject control, DependencyPropertyChangedEventArgs e) - { - if (control is DayColumnControl columnControl) - { - columnControl.RegisterEventsCollectionHandlers(); - columnControl.UpdateValues(); - } - } - - private void OnUnloaded(object sender, RoutedEventArgs e) - { - DeregisterEventsCollectionHandlers(); - } - - private bool IsMonthlyTemplate() => ColumnHeaderText == null; - - private void RegisterEventsCollectionHandlers() - { - var nextCollection = DayModel?.EventsCollection; - if (ReferenceEquals(_boundEventsCollection, nextCollection)) - return; - - DeregisterEventsCollectionHandlers(); - - _boundEventsCollection = nextCollection; - if (_boundEventsCollection == null) - return; - - ((INotifyCollectionChanged)_boundEventsCollection.AllDayEvents).CollectionChanged += EventsCollectionChanged; - ((INotifyCollectionChanged)_boundEventsCollection.RegularEvents).CollectionChanged += EventsCollectionChanged; - } - - private void DeregisterEventsCollectionHandlers() - { - if (_boundEventsCollection == null) - return; - - ((INotifyCollectionChanged)_boundEventsCollection.AllDayEvents).CollectionChanged -= EventsCollectionChanged; - ((INotifyCollectionChanged)_boundEventsCollection.RegularEvents).CollectionChanged -= EventsCollectionChanged; - _boundEventsCollection = null; - } - - private void EventsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - UpdateEventItemsSource(); - } - - private void UpdateEventItemsSource() - { - if (AllDayItemsControl == null || DayModel == null) return; - - if (IsMonthlyTemplate()) - { - // Month cells should show all events for the day, not only all-day/multi-day. - var monthlyItems = DayModel.EventsCollection.AllDayEvents - .Concat(DayModel.EventsCollection.RegularEvents) - .GroupBy(a => a.Id) - .Select(g => g.First()) - .OrderBy(a => a.StartDate) - .ToList(); - - AllDayItemsControl.ItemsSource = monthlyItems; - return; - } - - AllDayItemsControl.ItemsSource = DayModel.EventsCollection.AllDayEvents; - } - - private void UpdateValues() - { - if (DayModel == null) return; - - if (HeaderDateDayText != null) - { - HeaderDateDayText.Text = DayModel.RepresentingDate.Day.ToString(); - } - - // Monthly template does not use it. - if (ColumnHeaderText != null) - { - ColumnHeaderText.Text = DayModel.RepresentingDate.ToString("dddd", DayModel.CalendarRenderOptions.CalendarSettings.CultureInfo); - } - - UpdateEventItemsSource(); - - if (IsTodayBorder == null) return; - bool isToday = DayModel.RepresentingDate.Date == DateTime.Now.Date; - - VisualStateManager.GoToState(this, isToday ? TodayState : NotTodayState, false); - - UpdateLayout(); - } -} diff --git a/Wino.Calendar/Controls/DayHeaderControl.cs b/Wino.Calendar/Controls/DayHeaderControl.cs deleted file mode 100644 index 567cdaef..00000000 --- a/Wino.Calendar/Controls/DayHeaderControl.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Core.Domain.Enums; - -namespace Wino.Calendar.Controls; - -public partial class DayHeaderControl : Control -{ - private const string PART_DayHeaderTextBlock = nameof(PART_DayHeaderTextBlock); - private TextBlock HeaderTextblock; - - public DayHeaderDisplayType DisplayType - { - get { return (DayHeaderDisplayType)GetValue(DisplayTypeProperty); } - set { SetValue(DisplayTypeProperty, value); } - } - - public DateTime Date - { - get { return (DateTime)GetValue(DateProperty); } - set { SetValue(DateProperty, value); } - } - - public static readonly DependencyProperty DateProperty = DependencyProperty.Register(nameof(Date), typeof(DateTime), typeof(DayHeaderControl), new PropertyMetadata(default(DateTime), new PropertyChangedCallback(OnHeaderPropertyChanged))); - public static readonly DependencyProperty DisplayTypeProperty = DependencyProperty.Register(nameof(DisplayType), typeof(DayHeaderDisplayType), typeof(DayHeaderControl), new PropertyMetadata(DayHeaderDisplayType.TwentyFourHour, new PropertyChangedCallback(OnHeaderPropertyChanged))); - - public DayHeaderControl() - { - DefaultStyleKey = typeof(DayHeaderControl); - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - HeaderTextblock = GetTemplateChild(PART_DayHeaderTextBlock) as TextBlock; - UpdateHeaderText(); - } - - private static void OnHeaderPropertyChanged(DependencyObject control, DependencyPropertyChangedEventArgs e) - { - if (control is DayHeaderControl headerControl) - { - headerControl.UpdateHeaderText(); - } - } - - private void UpdateHeaderText() - { - if (HeaderTextblock != null) - { - HeaderTextblock.Text = DisplayType == DayHeaderDisplayType.TwelveHour ? Date.ToString("h tt") : Date.ToString("HH:mm"); - } - } -} diff --git a/Wino.Calendar/Controls/WinoCalendarControl.cs b/Wino.Calendar/Controls/WinoCalendarControl.cs deleted file mode 100644 index 3f613041..00000000 --- a/Wino.Calendar/Controls/WinoCalendarControl.cs +++ /dev/null @@ -1,315 +0,0 @@ -using System; -using System.Collections.ObjectModel; -using System.Linq; -using System.Threading.Tasks; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Calendar.Args; -using Wino.Calendar.ViewModels.Data; -using Wino.Core.Domain.Enums; -using Wino.Core.Domain.Models.Calendar; -using Wino.Helpers; - -namespace Wino.Calendar.Controls; - -public partial class WinoCalendarControl : Control -{ - private const string PART_WinoFlipView = nameof(PART_WinoFlipView); - private const string PART_IdleGrid = nameof(PART_IdleGrid); - - public event EventHandler TimelineCellSelected; - public event EventHandler TimelineCellUnselected; - - public event EventHandler ScrollPositionChanging; - - #region Dependency Properties - - public static readonly DependencyProperty DayRangesProperty = DependencyProperty.Register(nameof(DayRanges), typeof(ObservableCollection), typeof(WinoCalendarControl), new PropertyMetadata(null)); - public static readonly DependencyProperty SelectedFlipViewIndexProperty = DependencyProperty.Register(nameof(SelectedFlipViewIndex), typeof(int), typeof(WinoCalendarControl), new PropertyMetadata(-1)); - public static readonly DependencyProperty SelectedFlipViewDayRangeProperty = DependencyProperty.Register(nameof(SelectedFlipViewDayRange), typeof(DayRangeRenderModel), typeof(WinoCalendarControl), new PropertyMetadata(null)); - public static readonly DependencyProperty ActiveCanvasProperty = DependencyProperty.Register(nameof(ActiveCanvas), typeof(WinoDayTimelineCanvas), typeof(WinoCalendarControl), new PropertyMetadata(null, new PropertyChangedCallback(OnActiveCanvasChanged))); - public static readonly DependencyProperty IsFlipIdleProperty = DependencyProperty.Register(nameof(IsFlipIdle), typeof(bool), typeof(WinoCalendarControl), new PropertyMetadata(true, new PropertyChangedCallback(OnIdleStateChanged))); - public static readonly DependencyProperty ActiveScrollViewerProperty = DependencyProperty.Register(nameof(ActiveScrollViewer), typeof(ScrollViewer), typeof(WinoCalendarControl), new PropertyMetadata(null, new PropertyChangedCallback(OnActiveVerticalScrollViewerChanged))); - - public static readonly DependencyProperty VerticalItemsPanelTemplateProperty = DependencyProperty.Register(nameof(VerticalItemsPanelTemplate), typeof(ItemsPanelTemplate), typeof(WinoCalendarControl), new PropertyMetadata(null, new PropertyChangedCallback(OnCalendarOrientationPropertiesUpdated))); - public static readonly DependencyProperty HorizontalItemsPanelTemplateProperty = DependencyProperty.Register(nameof(HorizontalItemsPanelTemplate), typeof(ItemsPanelTemplate), typeof(WinoCalendarControl), new PropertyMetadata(null, new PropertyChangedCallback(OnCalendarOrientationPropertiesUpdated))); - public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(nameof(Orientation), typeof(CalendarOrientation), typeof(WinoCalendarControl), new PropertyMetadata(CalendarOrientation.Horizontal, new PropertyChangedCallback(OnCalendarOrientationPropertiesUpdated))); - public static readonly DependencyProperty DisplayTypeProperty = DependencyProperty.Register(nameof(DisplayType), typeof(CalendarDisplayType), typeof(WinoCalendarControl), new PropertyMetadata(CalendarDisplayType.Day, new PropertyChangedCallback(OnDisplayTypeChanged))); - - /// - /// Gets or sets the day-week-month-year display type. - /// Orientation is not determined by this property, but Orientation property. - /// This property is used to determine the template to use for the calendar. - /// - public CalendarDisplayType DisplayType - { - get { return (CalendarDisplayType)GetValue(DisplayTypeProperty); } - set { SetValue(DisplayTypeProperty, value); } - } - - public CalendarOrientation Orientation - { - get { return (CalendarOrientation)GetValue(OrientationProperty); } - set { SetValue(OrientationProperty, value); } - } - - public ItemsPanelTemplate VerticalItemsPanelTemplate - { - get { return (ItemsPanelTemplate)GetValue(VerticalItemsPanelTemplateProperty); } - set { SetValue(VerticalItemsPanelTemplateProperty, value); } - } - - public ItemsPanelTemplate HorizontalItemsPanelTemplate - { - get { return (ItemsPanelTemplate)GetValue(HorizontalItemsPanelTemplateProperty); } - set { SetValue(HorizontalItemsPanelTemplateProperty, value); } - } - - public DayRangeRenderModel SelectedFlipViewDayRange - { - get { return (DayRangeRenderModel)GetValue(SelectedFlipViewDayRangeProperty); } - set { SetValue(SelectedFlipViewDayRangeProperty, value); } - } - - public ScrollViewer ActiveScrollViewer - { - get { return (ScrollViewer)GetValue(ActiveScrollViewerProperty); } - set { SetValue(ActiveScrollViewerProperty, value); } - } - - public WinoDayTimelineCanvas ActiveCanvas - { - get { return (WinoDayTimelineCanvas)GetValue(ActiveCanvasProperty); } - set { SetValue(ActiveCanvasProperty, value); } - } - - public bool IsFlipIdle - { - get { return (bool)GetValue(IsFlipIdleProperty); } - set { SetValue(IsFlipIdleProperty, value); } - } - - /// - /// Gets or sets the collection of day ranges to render. - /// Each day range usually represents a week, but it may support other ranges. - /// - public ObservableCollection DayRanges - { - get { return (ObservableCollection)GetValue(DayRangesProperty); } - set { SetValue(DayRangesProperty, value); } - } - - public int SelectedFlipViewIndex - { - get { return (int)GetValue(SelectedFlipViewIndexProperty); } - set { SetValue(SelectedFlipViewIndexProperty, value); } - } - - #endregion - - private WinoCalendarFlipView InternalFlipView; - private Grid IdleGrid; - - public WinoCalendarControl() - { - DefaultStyleKey = typeof(WinoCalendarControl); - SizeChanged += CalendarSizeChanged; - } - - private static void OnCalendarOrientationPropertiesUpdated(DependencyObject calendar, DependencyPropertyChangedEventArgs e) - { - if (calendar is WinoCalendarControl control) - { - control.ManageCalendarOrientation(); - } - } - - private static void OnIdleStateChanged(DependencyObject calendar, DependencyPropertyChangedEventArgs e) - { - if (calendar is WinoCalendarControl calendarControl) - { - calendarControl.UpdateIdleState(); - } - } - - - private static void OnActiveVerticalScrollViewerChanged(DependencyObject calendar, DependencyPropertyChangedEventArgs e) - { - if (calendar is WinoCalendarControl calendarControl) - { - if (e.OldValue is ScrollViewer oldScrollViewer) - { - calendarControl.DeregisterScrollChanges(oldScrollViewer); - } - - if (e.NewValue is ScrollViewer newScrollViewer) - { - calendarControl.RegisterScrollChanges(newScrollViewer); - } - - calendarControl.ManageHighlightedDateRange(); - } - } - - - private static void OnActiveCanvasChanged(DependencyObject calendar, DependencyPropertyChangedEventArgs e) - { - if (calendar is WinoCalendarControl calendarControl) - { - if (e.OldValue is WinoDayTimelineCanvas oldCanvas) - { - // Dismiss any selection on the old canvas. - calendarControl.DeregisterCanvas(oldCanvas); - } - - if (e.NewValue is WinoDayTimelineCanvas newCanvas) - { - calendarControl.RegisterCanvas(newCanvas); - } - - calendarControl.ManageHighlightedDateRange(); - } - } - - private static void OnDisplayTypeChanged(DependencyObject calendar, DependencyPropertyChangedEventArgs e) - { - if (calendar is WinoCalendarControl calendarControl) - { - calendarControl.ManageDisplayType(); - } - } - - private void ManageCalendarOrientation() - { - if (InternalFlipView == null || HorizontalItemsPanelTemplate == null || VerticalItemsPanelTemplate == null) return; - - InternalFlipView.ItemsPanel = Orientation == CalendarOrientation.Horizontal ? HorizontalItemsPanelTemplate : VerticalItemsPanelTemplate; - } - - private void ManageDisplayType() - { - if (InternalFlipView == null) return; - - InternalFlipView.DisplayType = DisplayType; - } - - private void ManageHighlightedDateRange() - => SelectedFlipViewDayRange = InternalFlipView.SelectedItem as DayRangeRenderModel; - - private void DeregisterCanvas(WinoDayTimelineCanvas canvas) - { - if (canvas == null) return; - - canvas.SelectedDateTime = null; - canvas.TimelineCellSelected -= ActiveTimelineCellSelected; - canvas.TimelineCellUnselected -= ActiveTimelineCellUnselected; - } - - private void RegisterCanvas(WinoDayTimelineCanvas canvas) - { - if (canvas == null) return; - - canvas.SelectedDateTime = null; - canvas.TimelineCellSelected += ActiveTimelineCellSelected; - canvas.TimelineCellUnselected += ActiveTimelineCellUnselected; - } - - private void RegisterScrollChanges(ScrollViewer scrollViewer) - { - if (scrollViewer == null) return; - - scrollViewer.ViewChanging += ScrollViewChanging; - } - - private void DeregisterScrollChanges(ScrollViewer scrollViewer) - { - if (scrollViewer == null) return; - - scrollViewer.ViewChanging -= ScrollViewChanging; - } - - private void ScrollViewChanging(object sender, ScrollViewerViewChangingEventArgs e) - => ScrollPositionChanging?.Invoke(this, EventArgs.Empty); - - private void CalendarSizeChanged(object sender, SizeChangedEventArgs e) - { - if (ActiveCanvas == null) return; - - ActiveCanvas.SelectedDateTime = null; - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - InternalFlipView = GetTemplateChild(PART_WinoFlipView) as WinoCalendarFlipView; - IdleGrid = GetTemplateChild(PART_IdleGrid) as Grid; - - UpdateIdleState(); - ManageCalendarOrientation(); - ManageDisplayType(); - } - - private void UpdateIdleState() - { - InternalFlipView.Opacity = IsFlipIdle ? 0 : 1; - IdleGrid.Visibility = IsFlipIdle ? Visibility.Visible : Visibility.Collapsed; - } - - private void ActiveTimelineCellUnselected(object sender, TimelineCellUnselectedArgs e) - => TimelineCellUnselected?.Invoke(this, e); - - private void ActiveTimelineCellSelected(object sender, TimelineCellSelectedArgs e) - => TimelineCellSelected?.Invoke(this, e); - - public void NavigateToDay(DateTime dateTime) => InternalFlipView.NavigateToDay(dateTime); - - public async void NavigateToHour(TimeSpan timeSpan) - { - if (ActiveScrollViewer == null) return; - - // Total height of the FlipViewItem is the same as vertical ScrollViewer to position day headers. - - await Task.Yield(); - await DispatcherQueue.EnqueueAsync(() => - { - double hourHeght = 60; - double totalHeight = ActiveScrollViewer.ScrollableHeight; - double scrollPosition = timeSpan.TotalHours * hourHeght; - - ActiveScrollViewer.ChangeView(null, scrollPosition, null, disableAnimation: false); - }); - } - public void ResetTimelineSelection() - { - if (ActiveCanvas == null) return; - - ActiveCanvas.SelectedDateTime = null; - } - - public void GoNextRange() - { - if (InternalFlipView == null) return; - - InternalFlipView.GoNextFlip(); - } - - public void GoPreviousRange() - { - if (InternalFlipView == null) return; - - InternalFlipView.GoPreviousFlip(); - } - - public void UnselectActiveTimelineCell() - { - if (ActiveCanvas == null) return; - - ActiveCanvas.SelectedDateTime = null; - } - - public CalendarItemControl GetCalendarItemControl(CalendarItemViewModel calendarItemViewModel) - { - return this.FindDescendants().FirstOrDefault(a => a.CalendarItem == calendarItemViewModel); - } -} diff --git a/Wino.Calendar/Controls/WinoCalendarFlipView.cs b/Wino.Calendar/Controls/WinoCalendarFlipView.cs deleted file mode 100644 index b838dd75..00000000 --- a/Wino.Calendar/Controls/WinoCalendarFlipView.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Collections.Specialized; -using System.Linq; -using System.Threading.Tasks; -using CommunityToolkit.WinUI; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Core.Domain.Collections; -using Wino.Core.Domain.Models.Calendar; - -namespace Wino.Calendar.Controls; - -public partial class WinoCalendarFlipView : CustomCalendarFlipView -{ - public static readonly DependencyProperty IsIdleProperty = DependencyProperty.Register(nameof(IsIdle), typeof(bool), typeof(WinoCalendarFlipView), new PropertyMetadata(true)); - public static readonly DependencyProperty ActiveCanvasProperty = DependencyProperty.Register(nameof(ActiveCanvas), typeof(WinoDayTimelineCanvas), typeof(WinoCalendarFlipView), new PropertyMetadata(null)); - public static readonly DependencyProperty ActiveVerticalScrollViewerProperty = DependencyProperty.Register(nameof(ActiveVerticalScrollViewer), typeof(ScrollViewer), typeof(WinoCalendarFlipView), new PropertyMetadata(null)); - - /// - /// Gets or sets the active canvas that is currently displayed in the flip view. - /// Each day-range of flip view item has a canvas that displays the day timeline. - /// - public WinoDayTimelineCanvas ActiveCanvas - { - get { return (WinoDayTimelineCanvas)GetValue(ActiveCanvasProperty); } - set { SetValue(ActiveCanvasProperty, value); } - } - - /// - /// Gets or sets the scroll viewer that is currently active in the flip view. - /// It's the vertical scroll that scrolls the timeline only, not the header part that belongs - /// to parent FlipView control. - /// - public ScrollViewer ActiveVerticalScrollViewer - { - get { return (ScrollViewer)GetValue(ActiveVerticalScrollViewerProperty); } - set { SetValue(ActiveVerticalScrollViewerProperty, value); } - } - - public bool IsIdle - { - get { return (bool)GetValue(IsIdleProperty); } - set { SetValue(IsIdleProperty, value); } - } - - public WinoCalendarFlipView() - { - RegisterPropertyChangedCallback(SelectedIndexProperty, new DependencyPropertyChangedCallback(OnSelectedIndexUpdated)); - RegisterPropertyChangedCallback(ItemsSourceProperty, new DependencyPropertyChangedCallback(OnItemsSourceChanged)); - } - - private static void OnItemsSourceChanged(DependencyObject d, DependencyProperty e) - { - if (d is WinoCalendarFlipView flipView) - { - flipView.RegisterItemsSourceChange(); - } - } - - private static void OnSelectedIndexUpdated(DependencyObject d, DependencyProperty e) - { - if (d is WinoCalendarFlipView flipView) - { - flipView.UpdateActiveCanvas(); - flipView.UpdateActiveScrollViewer(); - } - } - - private void RegisterItemsSourceChange() - { - if (GetItemsSource() is INotifyCollectionChanged notifyCollectionChanged) - { - notifyCollectionChanged.CollectionChanged += ItemsSourceUpdated; - } - } - - private void ItemsSourceUpdated(object sender, NotifyCollectionChangedEventArgs e) - { - IsIdle = e.Action == NotifyCollectionChangedAction.Reset || e.Action == NotifyCollectionChangedAction.Replace; - } - - private async Task GetCurrentFlipViewItem() - { - // TODO: Refactor this mechanism by listening to PrepareContainerForItemOverride and Loaded events together. - while (ContainerFromIndex(SelectedIndex) == null) - { - await Task.Delay(100); - } - - return ContainerFromIndex(SelectedIndex) as FlipViewItem; - - - } - - private void UpdateActiveScrollViewer() - { - if (SelectedIndex < 0) - ActiveVerticalScrollViewer = null; - else - { - GetCurrentFlipViewItem().ContinueWith(task => - { - if (task.IsCompletedSuccessfully) - { - var flipViewItem = task.Result; - - _ = DispatcherQueue.TryEnqueue(() => - { - ActiveVerticalScrollViewer = flipViewItem.FindDescendant(); - }); - } - }); - } - } - - public void UpdateActiveCanvas() - { - if (SelectedIndex < 0) - ActiveCanvas = null; - else - { - GetCurrentFlipViewItem().ContinueWith(task => - { - if (task.IsCompletedSuccessfully) - { - var flipViewItem = task.Result; - - _ = DispatcherQueue.TryEnqueue(() => - { - ActiveCanvas = flipViewItem.FindDescendant(); - }); - } - }); - } - } - - /// - /// Navigates to the specified date in the calendar. - /// - /// Date to navigate. - public async void NavigateToDay(DateTime dateTime) - { - await Task.Yield(); - - await DispatcherQueue.EnqueueAsync(() => - { - // Find the day range that contains the date. - var dayRange = GetItemsSource()?.FirstOrDefault(a => a.CalendarDays.Any(b => b.RepresentingDate.Date == dateTime.Date)); - - if (dayRange != null) - { - var navigationItemIndex = GetItemsSource().IndexOf(dayRange); - - if (Math.Abs(navigationItemIndex - SelectedIndex) > 4) - { - // Difference between dates are high. - // No need to animate this much, just go without animating. - - SelectedIndex = navigationItemIndex; - } - else - { - // Until we reach the day in the flip, simulate next-prev button clicks. - // This will make sure the FlipView animations are triggered. - // Setting SelectedIndex directly doesn't trigger the animations. - - while (SelectedIndex != navigationItemIndex) - { - if (SelectedIndex > navigationItemIndex) - { - GoPreviousFlip(); - } - else - { - GoNextFlip(); - } - } - } - } - }); - } - - private ObservableRangeCollection GetItemsSource() - => ItemsSource as ObservableRangeCollection; -} diff --git a/Wino.Calendar/Controls/WinoCalendarPanel.cs b/Wino.Calendar/Controls/WinoCalendarPanel.cs deleted file mode 100644 index c76801ea..00000000 --- a/Wino.Calendar/Controls/WinoCalendarPanel.cs +++ /dev/null @@ -1,293 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; -using CommunityToolkit.WinUI; -using Itenso.TimePeriod; -using Windows.Foundation; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Calendar.Models; -using Wino.Calendar.ViewModels.Data; -using Wino.Core.Domain.Interfaces; - -namespace Wino.Calendar.Controls; - -public partial class WinoCalendarPanel : Panel -{ - private const double LastItemRightExtraMargin = 12d; - - // Store each ICalendarItem measurements by their Id. - private readonly Dictionary _measurements = new Dictionary(); - - public static readonly DependencyProperty EventItemMarginProperty = DependencyProperty.Register(nameof(EventItemMargin), typeof(Thickness), typeof(WinoCalendarPanel), new PropertyMetadata(new Thickness(0, 0, 0, 0))); - public static readonly DependencyProperty HourHeightProperty = DependencyProperty.Register(nameof(HourHeight), typeof(double), typeof(WinoCalendarPanel), new PropertyMetadata(0d)); - public static readonly DependencyProperty PeriodProperty = DependencyProperty.Register(nameof(Period), typeof(ITimePeriod), typeof(WinoCalendarPanel), new PropertyMetadata(null)); - - public ITimePeriod Period - { - get { return (ITimePeriod)GetValue(PeriodProperty); } - set { SetValue(PeriodProperty, value); } - } - - public double HourHeight - { - get { return (double)GetValue(HourHeightProperty); } - set { SetValue(HourHeightProperty, value); } - } - - public Thickness EventItemMargin - { - get { return (Thickness)GetValue(EventItemMarginProperty); } - set { SetValue(EventItemMarginProperty, value); } - } - - private void ResetMeasurements() => _measurements.Clear(); - - private double GetChildTopMargin(ICalendarItem calendarItemViewModel, double availableHeight) - { - var childStart = calendarItemViewModel.StartDate; - - if (childStart <= Period.Start) - { - // Event started before or exactly at the periods tart. This might be a multi-day event. - // We can simply consider event must not have a top margin. - - return 0d; - } - - double minutesFromStart = (childStart - Period.Start).TotalMinutes; - return (minutesFromStart / 1440) * availableHeight; - } - - private double GetChildWidth(CalendarItemMeasurement calendarItemMeasurement, double availableWidth) - { - return (calendarItemMeasurement.Right - calendarItemMeasurement.Left) * availableWidth; - } - - private double GetChildLeftMargin(CalendarItemMeasurement calendarItemMeasurement, double availableWidth) - => availableWidth * calendarItemMeasurement.Left; - - private double GetChildHeight(ICalendarItem child) - { - // All day events are not measured. - if (child.IsAllDayEvent) return 0; - - double childDurationInMinutes = 0d; - double availableHeight = HourHeight * 24; - - var periodRelation = child.Period.GetRelation(Period); - - // Debug.WriteLine($"Render relation of {child.Title} ({child.Period.Start} - {child.Period.End}) is {periodRelation} with {Period.Start.Day}"); - - if (!child.IsMultiDayEvent) - { - childDurationInMinutes = child.Period.Duration.TotalMinutes; - } - else - { - // Multi-day event. - // Check how many of the event falls into the current period. - childDurationInMinutes = (child.Period.End - Period.Start).TotalMinutes; - } - - return (childDurationInMinutes / 1440) * availableHeight; - } - - protected override Size MeasureOverride(Size availableSize) - { - ResetMeasurements(); - return base.MeasureOverride(availableSize); - } - - protected override Size ArrangeOverride(Size finalSize) - { - if (Period == null || HourHeight == 0d) return finalSize; - - // Measure/arrange each child height and width. - // This is a vertical calendar. Therefore the height of each child is the duration of the event. - // Children weights for left and right will be saved if they don't exist. - // This is important because we don't want to measure the weights again. - // They don't change until new event is added or removed. - // Width of the each child may depend on the rectangle packing algorithm. - // Children are first categorized into columns. Then each column is shifted to the left until - // no overlap occurs. The width of each child is calculated based on the number of columns it spans. - - double availableHeight = finalSize.Height; - double availableWidth = finalSize.Width; - - var calendarControls = Children.Cast(); - - if (!calendarControls.Any()) return base.ArrangeOverride(finalSize); - - var events = calendarControls.Select(a => a.Content as CalendarItemViewModel); - - LayoutEvents(events); - - foreach (var control in calendarControls) - { - // We can't arrange this child. - if (!(control.Content is ICalendarItem child)) continue; - - bool isHorizontallyLastItem = false; - - double childWidth = 0, - childHeight = Math.Max(0, GetChildHeight(child)), - childTop = Math.Max(0, GetChildTopMargin(child, availableHeight)), - childLeft = 0; - - // No need to measure anything here. - if (childHeight == 0) continue; - - if (!_measurements.ContainsKey(child)) - { - // Multi-day event. - - childLeft = 0; - childWidth = availableWidth; - } - else - { - var childMeasurement = _measurements[child]; - - childWidth = Math.Max(0, GetChildWidth(childMeasurement, finalSize.Width)); - childLeft = Math.Max(0, GetChildLeftMargin(childMeasurement, availableWidth)); - - isHorizontallyLastItem = childMeasurement.Right == 1; - } - - // Add additional right margin to items that falls on the right edge of the panel. - double extraRightMargin = 0; - - // Multi-day events don't have any margin and their hit test is disabled. - if (!child.IsMultiDayEvent) - { - // Max of 5% of the width or 20px max. - extraRightMargin = isHorizontallyLastItem ? Math.Max(LastItemRightExtraMargin, finalSize.Width * 5 / 100) : 0; - } - - if (childWidth < 0) childWidth = 1; - - // Regular events must have 2px margin - if (!child.IsMultiDayEvent && !child.IsAllDayEvent) - { - childLeft += 2; - childTop += 2; - childHeight -= 2; - childWidth -= 2; - } - - var arrangementRect = new Rect(childLeft + EventItemMargin.Left, childTop + EventItemMargin.Top, Math.Max(childWidth - extraRightMargin, 1), childHeight); - - // Make sure measured size will fit in the arranged box. - var measureSize = arrangementRect.ToSize(); - control.Measure(measureSize); - control.Arrange(arrangementRect); - - //Debug.WriteLine($"{child.Title}, Measured: {measureSize}, Arranged: {arrangementRect}"); - } - - - return finalSize; - } - - #region ColumSpanning and Packing Algorithm - - private void AddOrUpdateMeasurement(ICalendarItem calendarItem, CalendarItemMeasurement measurement) - { - if (_measurements.ContainsKey(calendarItem)) - { - _measurements[calendarItem] = measurement; - } - else - { - _measurements.Add(calendarItem, measurement); - } - } - - // Pick the left and right positions of each event, such that there are no overlap. - private void LayoutEvents(IEnumerable events) - { - var columns = new List>(); - DateTime? lastEventEnding = null; - - foreach (var ev in events.OrderBy(ev => ev.StartDate).ThenBy(ev => ev.EndDate)) - { - // Multi-day events are not measured. - if (ev.IsMultiDayEvent) continue; - - if (ev.Period.Start >= lastEventEnding) - { - PackEvents(columns); - columns.Clear(); - lastEventEnding = null; - } - - bool placed = false; - - foreach (var col in columns) - { - if (!col.Last().Period.OverlapsWith(ev.Period)) - { - col.Add(ev); - placed = true; - break; - } - } - if (!placed) - { - columns.Add(new List { ev }); - } - if (lastEventEnding == null || ev.Period.End > lastEventEnding.Value) - { - lastEventEnding = ev.Period.End; - } - } - if (columns.Count > 0) - { - PackEvents(columns); - } - } - - // Set the left and right positions for each event in the connected group. - private void PackEvents(List> columns) - { - float numColumns = columns.Count; - int iColumn = 0; - - foreach (var col in columns) - { - foreach (var ev in col) - { - int colSpan = ExpandEvent(ev, iColumn, columns); - - var leftWeight = iColumn / numColumns; - var rightWeight = (iColumn + colSpan) / numColumns; - - AddOrUpdateMeasurement(ev, new CalendarItemMeasurement(leftWeight, rightWeight)); - } - - iColumn++; - } - } - - // Checks how many columns the event can expand into, without colliding with other events. - private int ExpandEvent(ICalendarItem ev, int iColumn, List> columns) - { - int colSpan = 1; - - foreach (var col in columns.Skip(iColumn + 1)) - { - foreach (var ev1 in col) - { - if (ev1.Period.OverlapsWith(ev.Period)) return colSpan; - } - - colSpan++; - } - - return colSpan; - } - - #endregion -} diff --git a/Wino.Calendar/Controls/WinoCalendarTypeSelectorControl.cs b/Wino.Calendar/Controls/WinoCalendarTypeSelectorControl.cs deleted file mode 100644 index e15c4330..00000000 --- a/Wino.Calendar/Controls/WinoCalendarTypeSelectorControl.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Windows.Input; -using CommunityToolkit.Diagnostics; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Core.Domain.Enums; - -namespace Wino.Calendar.Controls; - -public partial class WinoCalendarTypeSelectorControl : Control -{ - private const string PART_TodayButton = nameof(PART_TodayButton); - private const string PART_DayToggle = nameof(PART_DayToggle); - private const string PART_WeekToggle = nameof(PART_WeekToggle); - private const string PART_MonthToggle = nameof(PART_MonthToggle); - - public static readonly DependencyProperty SelectedTypeProperty = DependencyProperty.Register( - nameof(SelectedType), - typeof(CalendarDisplayType), - typeof(WinoCalendarTypeSelectorControl), - new PropertyMetadata(CalendarDisplayType.Week, new PropertyChangedCallback(OnSelectedTypeChanged))); - public static readonly DependencyProperty DisplayDayCountProperty = DependencyProperty.Register(nameof(DisplayDayCount), typeof(int), typeof(WinoCalendarTypeSelectorControl), new PropertyMetadata(0)); - public static readonly DependencyProperty TodayClickedCommandProperty = DependencyProperty.Register(nameof(TodayClickedCommand), typeof(ICommand), typeof(WinoCalendarTypeSelectorControl), new PropertyMetadata(null)); - - public ICommand TodayClickedCommand - { - get { return (ICommand)GetValue(TodayClickedCommandProperty); } - set { SetValue(TodayClickedCommandProperty, value); } - } - - public CalendarDisplayType SelectedType - { - get { return (CalendarDisplayType)GetValue(SelectedTypeProperty); } - set { SetValue(SelectedTypeProperty, value); } - } - - public int DisplayDayCount - { - get { return (int)GetValue(DisplayDayCountProperty); } - set { SetValue(DisplayDayCountProperty, value); } - } - - private AppBarButton _todayButton; - private AppBarToggleButton _dayToggle; - private AppBarToggleButton _weekToggle; - private AppBarToggleButton _monthToggle; - - public WinoCalendarTypeSelectorControl() - { - DefaultStyleKey = typeof(WinoCalendarTypeSelectorControl); - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - UnregisterHandlers(); - - _todayButton = GetTemplateChild(PART_TodayButton) as AppBarButton; - _dayToggle = GetTemplateChild(PART_DayToggle) as AppBarToggleButton; - _weekToggle = GetTemplateChild(PART_WeekToggle) as AppBarToggleButton; - _monthToggle = GetTemplateChild(PART_MonthToggle) as AppBarToggleButton; - - Guard.IsNotNull(_todayButton, nameof(_todayButton)); - Guard.IsNotNull(_dayToggle, nameof(_dayToggle)); - Guard.IsNotNull(_weekToggle, nameof(_weekToggle)); - Guard.IsNotNull(_monthToggle, nameof(_monthToggle)); - - _todayButton.Click += TodayClicked; - - _dayToggle.Click += (s, e) => { SetSelectedType(CalendarDisplayType.Day); }; - _weekToggle.Click += (s, e) => { SetSelectedType(CalendarDisplayType.Week); }; - _monthToggle.Click += (s, e) => { SetSelectedType(CalendarDisplayType.Month); }; - - UpdateToggleButtonStates(); - } - - private void TodayClicked(object sender, RoutedEventArgs e) => TodayClickedCommand?.Execute(null); - - private void SetSelectedType(CalendarDisplayType type) - { - SelectedType = type; - UpdateToggleButtonStates(); - } - - private static void OnSelectedTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - var control = d as WinoCalendarTypeSelectorControl; - control?.UpdateToggleButtonStates(); - } - - private void UnregisterHandlers() - { - if (_todayButton != null) - { - _todayButton.Click -= TodayClicked; - } - } - - private void UpdateToggleButtonStates() - { - if (_dayToggle == null || _weekToggle == null || _monthToggle == null) return; - - _dayToggle.IsChecked = SelectedType == CalendarDisplayType.Day; - _weekToggle.IsChecked = SelectedType == CalendarDisplayType.Week; - _monthToggle.IsChecked = SelectedType == CalendarDisplayType.Month; - } -} diff --git a/Wino.Calendar/Controls/WinoCalendarView.cs b/Wino.Calendar/Controls/WinoCalendarView.cs deleted file mode 100644 index 6048d03c..00000000 --- a/Wino.Calendar/Controls/WinoCalendarView.cs +++ /dev/null @@ -1,147 +0,0 @@ -using System; -using System.Windows.Input; -using CommunityToolkit.Diagnostics; -using Windows.UI; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media; -using Wino.Core.Domain.Models.Calendar; -using Wino.Helpers; - -namespace Wino.Calendar.Controls; - -public partial class WinoCalendarView : Control -{ - private const string PART_DayViewItemBorder = nameof(PART_DayViewItemBorder); - private const string PART_CalendarView = nameof(PART_CalendarView); - - public static readonly DependencyProperty HighlightedDateRangeProperty = DependencyProperty.Register(nameof(HighlightedDateRange), typeof(DateRange), typeof(WinoCalendarView), new PropertyMetadata(null, new PropertyChangedCallback(OnHighlightedDateRangeChanged))); - public static readonly DependencyProperty VisibleDateBackgroundProperty = DependencyProperty.Register(nameof(VisibleDateBackground), typeof(Brush), typeof(WinoCalendarView), new PropertyMetadata(null, new PropertyChangedCallback(OnPropertiesChanged))); - public static readonly DependencyProperty DateClickedCommandProperty = DependencyProperty.Register(nameof(DateClickedCommand), typeof(ICommand), typeof(WinoCalendarView), new PropertyMetadata(null)); - public static readonly DependencyProperty TodayBackgroundColorProperty = DependencyProperty.Register(nameof(TodayBackgroundColor), typeof(Color), typeof(WinoCalendarView), new PropertyMetadata(null)); - - public Color TodayBackgroundColor - { - get { return (Color)GetValue(TodayBackgroundColorProperty); } - set { SetValue(TodayBackgroundColorProperty, value); } - } - - /// - /// Gets or sets the command to execute when a date is picked. - /// Unused. - /// - public ICommand DateClickedCommand - { - get { return (ICommand)GetValue(DateClickedCommandProperty); } - set { SetValue(DateClickedCommandProperty, value); } - } - - /// - /// Gets or sets the highlighted range of dates. - /// - public DateRange HighlightedDateRange - { - get { return (DateRange)GetValue(HighlightedDateRangeProperty); } - set { SetValue(HighlightedDateRangeProperty, value); } - } - - public Brush VisibleDateBackground - { - get { return (Brush)GetValue(VisibleDateBackgroundProperty); } - set { SetValue(VisibleDateBackgroundProperty, value); } - } - - - - private CalendarView CalendarView; - - public WinoCalendarView() - { - DefaultStyleKey = typeof(WinoCalendarView); - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - CalendarView = GetTemplateChild(PART_CalendarView) as CalendarView; - - Guard.IsNotNull(CalendarView, nameof(CalendarView)); - - CalendarView.SelectedDatesChanged -= InternalCalendarViewSelectionChanged; - CalendarView.SelectedDatesChanged += InternalCalendarViewSelectionChanged; - - // TODO: Should come from settings. - CalendarView.FirstDayOfWeek = Windows.Globalization.DayOfWeek.Monday; - - // Everytime display mode changes, update the visible date range backgrounds. - // If users go back from year -> month -> day, we need to update the visible date range backgrounds. - - CalendarView.RegisterPropertyChangedCallback(CalendarView.DisplayModeProperty, (s, e) => UpdateVisibleDateRangeBackgrounds()); - } - - private void InternalCalendarViewSelectionChanged(CalendarView sender, CalendarViewSelectedDatesChangedEventArgs args) - { - if (args.AddedDates?.Count > 0) - { - var clickedDate = args.AddedDates[0].Date; - SetInnerDisplayDate(clickedDate); - - var clickArgs = new CalendarViewDayClickedEventArgs(clickedDate); - DateClickedCommand?.Execute(clickArgs); - } - - // Reset selection, we don't show selected dates but react to them. - CalendarView.SelectedDates.Clear(); - } - - private static void OnPropertiesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is WinoCalendarView control) - { - control.UpdateVisibleDateRangeBackgrounds(); - } - } - - private void SetInnerDisplayDate(DateTime dateTime) => CalendarView?.SetDisplayDate(dateTime); - - // Changing selected dates will trigger the selection changed event. - // It will behave like user clicked the date. - public void GoToDay(DateTime dateTime) => CalendarView.SelectedDates.Add(dateTime); - - private static void OnHighlightedDateRangeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is WinoCalendarView control) - { - control.SetInnerDisplayDate(control.HighlightedDateRange.StartDate); - control.UpdateVisibleDateRangeBackgrounds(); - } - } - - public void UpdateVisibleDateRangeBackgrounds() - { - if (HighlightedDateRange == null || VisibleDateBackground == null || TodayBackgroundColor == null || CalendarView == null) return; - - var markDateCalendarDayItems = WinoVisualTreeHelper.FindDescendants(CalendarView); - - foreach (var calendarDayItem in markDateCalendarDayItems) - { - var border = WinoVisualTreeHelper.GetChildObject(calendarDayItem, PART_DayViewItemBorder); - - if (border == null) return; - - if (calendarDayItem.Date.Date == DateTime.Today.Date) - { - border.Background = new SolidColorBrush(TodayBackgroundColor); - } - else if (calendarDayItem.Date.Date >= HighlightedDateRange.StartDate.Date && calendarDayItem.Date.Date < HighlightedDateRange.EndDate.Date) - { - border.Background = VisibleDateBackground; - } - else - { - border.Background = null; - } - } - } -} diff --git a/Wino.Calendar/Controls/WinoDayTimelineCanvas.cs b/Wino.Calendar/Controls/WinoDayTimelineCanvas.cs deleted file mode 100644 index 66b3bdd8..00000000 --- a/Wino.Calendar/Controls/WinoDayTimelineCanvas.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System; -using System.Diagnostics; -using Microsoft.Graphics.Canvas.Geometry; -using Microsoft.Graphics.Canvas.UI.Xaml; -using Windows.Foundation; -using Windows.UI.Input; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Media; -using Wino.Calendar.Args; -using Wino.Core.Domain.Models.Calendar; - -namespace Wino.Calendar.Controls; - -public partial class WinoDayTimelineCanvas : Control, IDisposable -{ - public event EventHandler TimelineCellSelected; - public event EventHandler TimelineCellUnselected; - - private const string PART_InternalCanvas = nameof(PART_InternalCanvas); - private CanvasControl Canvas; - - public static readonly DependencyProperty RenderOptionsProperty = DependencyProperty.Register(nameof(RenderOptions), typeof(CalendarRenderOptions), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null, new PropertyChangedCallback(OnRenderingPropertiesChanged))); - public static readonly DependencyProperty SeperatorColorProperty = DependencyProperty.Register(nameof(SeperatorColor), typeof(SolidColorBrush), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null, new PropertyChangedCallback(OnRenderingPropertiesChanged))); - public static readonly DependencyProperty HalfHourSeperatorColorProperty = DependencyProperty.Register(nameof(HalfHourSeperatorColor), typeof(SolidColorBrush), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null, new PropertyChangedCallback(OnRenderingPropertiesChanged))); - public static readonly DependencyProperty SelectedCellBackgroundBrushProperty = DependencyProperty.Register(nameof(SelectedCellBackgroundBrush), typeof(SolidColorBrush), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null, new PropertyChangedCallback(OnRenderingPropertiesChanged))); - public static readonly DependencyProperty WorkingHourCellBackgroundColorProperty = DependencyProperty.Register(nameof(WorkingHourCellBackgroundColor), typeof(SolidColorBrush), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null, new PropertyChangedCallback(OnRenderingPropertiesChanged))); - public static readonly DependencyProperty SelectedDateTimeProperty = DependencyProperty.Register(nameof(SelectedDateTime), typeof(DateTime?), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null, new PropertyChangedCallback(OnSelectedDateTimeChanged))); - public static readonly DependencyProperty PositionerUIElementProperty = DependencyProperty.Register(nameof(PositionerUIElement), typeof(UIElement), typeof(WinoDayTimelineCanvas), new PropertyMetadata(null)); - - public UIElement PositionerUIElement - { - get { return (UIElement)GetValue(PositionerUIElementProperty); } - set { SetValue(PositionerUIElementProperty, value); } - } - - public CalendarRenderOptions RenderOptions - { - get { return (CalendarRenderOptions)GetValue(RenderOptionsProperty); } - set { SetValue(RenderOptionsProperty, value); } - } - - public SolidColorBrush HalfHourSeperatorColor - { - get { return (SolidColorBrush)GetValue(HalfHourSeperatorColorProperty); } - set { SetValue(HalfHourSeperatorColorProperty, value); } - } - - public SolidColorBrush SeperatorColor - { - get { return (SolidColorBrush)GetValue(SeperatorColorProperty); } - set { SetValue(SeperatorColorProperty, value); } - } - - public SolidColorBrush WorkingHourCellBackgroundColor - { - get { return (SolidColorBrush)GetValue(WorkingHourCellBackgroundColorProperty); } - set { SetValue(WorkingHourCellBackgroundColorProperty, value); } - } - - public SolidColorBrush SelectedCellBackgroundBrush - { - get { return (SolidColorBrush)GetValue(SelectedCellBackgroundBrushProperty); } - set { SetValue(SelectedCellBackgroundBrushProperty, value); } - } - - public DateTime? SelectedDateTime - { - get { return (DateTime?)GetValue(SelectedDateTimeProperty); } - set { SetValue(SelectedDateTimeProperty, value); } - } - - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - Canvas = GetTemplateChild(PART_InternalCanvas) as CanvasControl; - - // TODO: These will leak. Dispose them properly when needed. - Canvas.Draw += OnCanvasDraw; - Canvas.PointerPressed += OnCanvasPointerPressed; - - ForceDraw(); - } - - private static void OnSelectedDateTimeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is WinoDayTimelineCanvas control) - { - if (e.OldValue != null && e.NewValue == null) - { - control.RaiseCellUnselected(); - } - - control.ForceDraw(); - } - } - - private void RaiseCellUnselected() - { - TimelineCellUnselected?.Invoke(this, new TimelineCellUnselectedArgs()); - } - - private void OnCanvasPointerPressed(object sender, Windows.UI.Xaml.Input.PointerRoutedEventArgs e) - { - if (RenderOptions == null) return; - - var hourHeight = RenderOptions.CalendarSettings.HourHeight; - - // When users click to cell we need to find the day, hour and minutes (first 30 minutes or second 30 minutes) that it represents on the timeline. - - PointerPoint positionerRootPoint = e.GetCurrentPoint(PositionerUIElement); - PointerPoint canvasPointerPoint = e.GetCurrentPoint(Canvas); - - Point touchPoint = canvasPointerPoint.Position; - - var singleDayWidth = (Canvas.ActualWidth / RenderOptions.TotalDayCount); - - int day = (int)(touchPoint.X / singleDayWidth); - int hour = (int)(touchPoint.Y / hourHeight); - - bool isSecondHalf = touchPoint.Y % hourHeight > (hourHeight / 2); - - var diffX = positionerRootPoint.Position.X - touchPoint.X; - var diffY = positionerRootPoint.Position.Y - touchPoint.Y; - - var cellStartRelativePositionX = diffX + (day * singleDayWidth); - var cellEndRelativePositionX = cellStartRelativePositionX + singleDayWidth; - - var cellStartRelativePositionY = diffY + (hour * hourHeight) + (isSecondHalf ? hourHeight / 2 : 0); - var cellEndRelativePositionY = cellStartRelativePositionY + (isSecondHalf ? (hourHeight / 2) : hourHeight); - - var cellSize = new Size(cellEndRelativePositionX - cellStartRelativePositionX, hourHeight / 2); - var positionerPoint = new Point(cellStartRelativePositionX, cellStartRelativePositionY); - - var clickedDateTime = RenderOptions.DateRange.StartDate.AddDays(day).AddHours(hour).AddMinutes(isSecondHalf ? 30 : 0); - - // If there is already a selected date, in order to mimic the popup behavior, we need to dismiss the previous selection first. - // Next click will be a new selection. - - // Raise the events directly here instead of DP to not lose pointer position. - if (clickedDateTime == SelectedDateTime || SelectedDateTime != null) - { - SelectedDateTime = null; - } - else - { - SelectedDateTime = clickedDateTime; - TimelineCellSelected?.Invoke(this, new TimelineCellSelectedArgs(clickedDateTime, touchPoint, positionerPoint, cellSize)); - } - - Debug.WriteLine($"Clicked: {clickedDateTime}"); - } - - public WinoDayTimelineCanvas() - { - DefaultStyleKey = typeof(WinoDayTimelineCanvas); - } - - private static void OnRenderingPropertiesChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - if (d is WinoDayTimelineCanvas control) - { - control.ForceDraw(); - } - } - - private void ForceDraw() => Canvas?.Invalidate(); - - private bool CanDrawTimeline() - { - return RenderOptions != null - && Canvas != null - && Canvas.ReadyToDraw - && WorkingHourCellBackgroundColor != null - && SeperatorColor != null - && HalfHourSeperatorColor != null - && SelectedCellBackgroundBrush != null; - } - - private void OnCanvasDraw(CanvasControl sender, CanvasDrawEventArgs args) - { - if (!CanDrawTimeline()) return; - - int hours = 24; - - double canvasWidth = Canvas.ActualWidth; - double canvasHeight = Canvas.ActualHeight; - - if (canvasWidth == 0 || canvasHeight == 0) return; - - // Calculate the width of each rectangle (1 day column) - // Equal distribution of the whole width. - double rectWidth = canvasWidth / RenderOptions.TotalDayCount; - - // Calculate the height of each rectangle (1 hour row) - double rectHeight = RenderOptions.CalendarSettings.HourHeight; - - // Define stroke and fill colors - var strokeColor = SeperatorColor.Color; - float strokeThickness = 0.5f; - - for (int day = 0; day < RenderOptions.TotalDayCount; day++) - { - var currentDay = RenderOptions.DateRange.StartDate.AddDays(day); - - bool isWorkingDay = RenderOptions.CalendarSettings.WorkingDays.Contains(currentDay.DayOfWeek); - - // Loop through each hour (rows) - for (int hour = 0; hour < hours; hour++) - { - var renderTime = TimeSpan.FromHours(hour); - - var representingDateTime = currentDay.AddHours(hour); - - // Calculate the position and size of the rectangle - double x = day * rectWidth; - double y = hour * rectHeight; - - var rectangle = new Rect(x, y, rectWidth, rectHeight); - - // Draw the rectangle border. - // This is the main rectangle. - args.DrawingSession.DrawRectangle(rectangle, strokeColor, strokeThickness); - - // Fill another rectangle with the working hour background color - // This rectangle must be placed with -1 margin to prevent invisible borders of the main rectangle. - if (isWorkingDay && renderTime >= RenderOptions.CalendarSettings.WorkingHourStart && renderTime <= RenderOptions.CalendarSettings.WorkingHourEnd) - { - var backgroundRectangle = new Rect(x + 1, y + 1, rectWidth - 1, rectHeight - 1); - - args.DrawingSession.DrawRectangle(backgroundRectangle, strokeColor, strokeThickness); - args.DrawingSession.FillRectangle(backgroundRectangle, WorkingHourCellBackgroundColor.Color); - } - - // Draw a line in the center of the rectangle for representing half hours. - double lineY = y + rectHeight / 2; - - args.DrawingSession.DrawLine((float)x, (float)lineY, (float)(x + rectWidth), (float)lineY, HalfHourSeperatorColor.Color, strokeThickness, new CanvasStrokeStyle() - { - DashStyle = CanvasDashStyle.Dot - }); - } - - // Draw selected item background color for the date if possible. - if (SelectedDateTime != null) - { - var selectedDateTime = SelectedDateTime.Value; - if (selectedDateTime.Date == currentDay.Date) - { - var selectionRectHeight = rectHeight / 2; - var selectedY = selectedDateTime.Hour * rectHeight + (selectedDateTime.Minute / 60) * rectHeight; - - // Second half of the hour is selected. - if (selectedDateTime.TimeOfDay.Minutes == 30) - { - selectedY += rectHeight / 2; - } - - var selectedRectangle = new Rect(day * rectWidth, selectedY, rectWidth, selectionRectHeight); - args.DrawingSession.FillRectangle(selectedRectangle, SelectedCellBackgroundBrush.Color); - } - } - } - } - - public void Dispose() - { - if (Canvas == null) return; - - Canvas.Draw -= OnCanvasDraw; - Canvas.PointerPressed -= OnCanvasPointerPressed; - Canvas.RemoveFromVisualTree(); - - Canvas = null; - } -} diff --git a/Wino.Calendar/Helpers/CalendarXamlHelpers.cs b/Wino.Calendar/Helpers/CalendarXamlHelpers.cs deleted file mode 100644 index cdc7c4d8..00000000 --- a/Wino.Calendar/Helpers/CalendarXamlHelpers.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.Linq; -using System.Text.RegularExpressions; -using Ical.Net.CalendarComponents; -using Ical.Net.DataTypes; -using Windows.UI.Xaml.Controls.Primitives; -using Wino.Calendar.ViewModels.Data; -using Wino.Core.Domain; -using Wino.Core.Domain.Collections; -using Wino.Core.Domain.Enums; -using Wino.Core.Domain.Models.Calendar; -using Wino.Helpers; - -namespace Wino.Calendar.Helpers; - -public static class CalendarXamlHelpers -{ - public static CalendarItemViewModel GetFirstAllDayEvent(CalendarEventCollection collection) - => (CalendarItemViewModel)collection.AllDayEvents.FirstOrDefault(); - - /// - /// Returns full date + duration info in Event Details page details title. - /// - public static string GetEventDetailsDateString(CalendarItemViewModel calendarItemViewModel, CalendarSettings settings) - { - if (calendarItemViewModel == null || settings == null) return string.Empty; - - var start = calendarItemViewModel.Period.Start; - var end = calendarItemViewModel.Period.End; - - string timeFormat = settings.DayHeaderDisplayType == DayHeaderDisplayType.TwelveHour ? "h:mm tt" : "HH:mm"; - string dateFormat = settings.DayHeaderDisplayType == DayHeaderDisplayType.TwelveHour ? "dddd, dd MMMM h:mm tt" : "dddd, dd MMMM HH:mm"; - - if (calendarItemViewModel.IsMultiDayEvent) - { - return $"{start.ToString($"dd MMMM ddd {timeFormat}", settings.CultureInfo)} - {end.ToString($"dd MMMM ddd {timeFormat}", settings.CultureInfo)}"; - } - else - { - return $"{start.ToString(dateFormat, settings.CultureInfo)} - {end.ToString(timeFormat, settings.CultureInfo)}"; - } - } - - public static string GetRecurrenceString(CalendarItemViewModel calendarItemViewModel) - { - if (calendarItemViewModel == null || !calendarItemViewModel.IsRecurringChild) return string.Empty; - - // Parse recurrence rules - var calendarEvent = new CalendarEvent - { - Start = new CalDateTime(calendarItemViewModel.StartDate), - End = new CalDateTime(calendarItemViewModel.EndDate), - }; - - var recurrenceLines = Regex.Split(calendarItemViewModel.CalendarItem.Recurrence, Constants.CalendarEventRecurrenceRuleSeperator); - - foreach (var line in recurrenceLines) - { - calendarEvent.RecurrenceRules.Add(new RecurrencePattern(line)); - } - - if (calendarEvent.RecurrenceRules == null || !calendarEvent.RecurrenceRules.Any()) - { - return "No recurrence pattern."; - } - - var recurrenceRule = calendarEvent.RecurrenceRules.First(); - var daysOfWeek = string.Join(", ", recurrenceRule.ByDay.Select(day => day.DayOfWeek.ToString())); - string timeZone = calendarEvent.DtStart.TzId ?? "UTC"; - - return $"Every {daysOfWeek}, effective {calendarEvent.DtStart.Value.ToShortDateString()} " + - $"from {calendarEvent.DtStart.Value.ToShortTimeString()} to {calendarEvent.DtEnd.Value.ToShortTimeString()} " + - $"{timeZone}."; - } - - public static string GetDetailsPopupDurationString(CalendarItemViewModel calendarItemViewModel, CalendarSettings settings) - { - if (calendarItemViewModel == null || settings == null) return string.Empty; - - // Single event in a day. - if (!calendarItemViewModel.IsAllDayEvent && !calendarItemViewModel.IsMultiDayEvent) - { - return $"{calendarItemViewModel.Period.Start.ToString("d", settings.CultureInfo)} {settings.GetTimeString(calendarItemViewModel.Period.Duration)}"; - } - else if (calendarItemViewModel.IsMultiDayEvent) - { - return $"{calendarItemViewModel.Period.Start.ToString("d", settings.CultureInfo)} - {calendarItemViewModel.Period.End.ToString("d", settings.CultureInfo)}"; - } - else - { - // All day event. - return $"{calendarItemViewModel.Period.Start.ToString("d", settings.CultureInfo)} ({Translator.CalendarItemAllDay})"; - } - } - - public static PopupPlacementMode GetDesiredPlacementModeForEventsDetailsPopup( - CalendarItemViewModel calendarItemViewModel, - CalendarDisplayType calendarDisplayType) - { - if (calendarItemViewModel == null) return PopupPlacementMode.Auto; - - // All and/or multi day events always go to the top of the screen. - if (calendarItemViewModel.IsAllDayEvent || calendarItemViewModel.IsMultiDayEvent) return PopupPlacementMode.Bottom; - - return XamlHelpers.GetPlaccementModeForCalendarType(calendarDisplayType); - } -} diff --git a/Wino.Calendar/MainPage.xaml b/Wino.Calendar/MainPage.xaml deleted file mode 100644 index f9187649..00000000 --- a/Wino.Calendar/MainPage.xaml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/Wino.Calendar/MainPage.xaml.cs b/Wino.Calendar/MainPage.xaml.cs deleted file mode 100644 index 7fb5bdf3..00000000 --- a/Wino.Calendar/MainPage.xaml.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Controls.Primitives; -using Windows.UI.Xaml.Data; -using Windows.UI.Xaml.Input; -using Windows.UI.Xaml.Media; -using Windows.UI.Xaml.Navigation; - -// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409 - -namespace Wino.Calendar; - -/// -/// An empty page that can be used on its own or navigated to within a Frame. -/// -public sealed partial class MainPage : Page -{ - public MainPage() - { - this.InitializeComponent(); - } -} diff --git a/Wino.Calendar/Models/CalendarItemMeasurement.cs b/Wino.Calendar/Models/CalendarItemMeasurement.cs deleted file mode 100644 index dbb8cf9b..00000000 --- a/Wino.Calendar/Models/CalendarItemMeasurement.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace Wino.Calendar.Models; - -public struct CalendarItemMeasurement -{ - // Where to start? - public double Left { get; set; } - - // Extend until where? - public double Right { get; set; } - - public CalendarItemMeasurement(double left, double right) - { - Left = left; - Right = right; - } -} diff --git a/Wino.Calendar/Package.appxmanifest b/Wino.Calendar/Package.appxmanifest deleted file mode 100644 index 7d96dede..00000000 --- a/Wino.Calendar/Package.appxmanifest +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - - - - - Wino Calendar - Burak KÖSE - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - - - - Google Auth Protocol - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Properties/launchSettings.json b/Wino.Calendar/Properties/launchSettings.json deleted file mode 100644 index 0f9c975c..00000000 --- a/Wino.Calendar/Properties/launchSettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "profiles": { - "Wino.Calendar": { - "commandName": "MsixPackage" - } - } -} diff --git a/Wino.Calendar/Selectors/CustomAreaCalendarItemSelector.cs b/Wino.Calendar/Selectors/CustomAreaCalendarItemSelector.cs deleted file mode 100644 index 253a82a6..00000000 --- a/Wino.Calendar/Selectors/CustomAreaCalendarItemSelector.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Calendar.ViewModels.Data; - -namespace Wino.Calendar.Selectors; - -public partial class CustomAreaCalendarItemSelector : DataTemplateSelector -{ - public DataTemplate AllDayTemplate { get; set; } - public DataTemplate MultiDayTemplate { get; set; } - - protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) - { - if (item is CalendarItemViewModel calendarItemViewModel) - { - return calendarItemViewModel.IsMultiDayEvent ? MultiDayTemplate : AllDayTemplate; - } - - return base.SelectTemplateCore(item, container); - } -} diff --git a/Wino.Calendar/Selectors/WinoCalendarItemTemplateSelector.cs b/Wino.Calendar/Selectors/WinoCalendarItemTemplateSelector.cs deleted file mode 100644 index 36287b67..00000000 --- a/Wino.Calendar/Selectors/WinoCalendarItemTemplateSelector.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Core.Domain.Enums; - -namespace Wino.Calendar.Selectors; - -public partial class WinoCalendarItemTemplateSelector : DataTemplateSelector -{ - public CalendarDisplayType DisplayType { get; set; } - - public DataTemplate DayWeekWorkWeekTemplate { get; set; } - public DataTemplate MonthlyTemplate { get; set; } - - - protected override DataTemplate SelectTemplateCore(object item, DependencyObject container) - { - switch (DisplayType) - { - case CalendarDisplayType.Day: - case CalendarDisplayType.Week: - case CalendarDisplayType.WorkWeek: - return DayWeekWorkWeekTemplate; - case CalendarDisplayType.Month: - return MonthlyTemplate; - default: - break; - } - - return base.SelectTemplateCore(item, container); - } -} diff --git a/Wino.Calendar/Services/AccountCalendarStateService.cs b/Wino.Calendar/Services/AccountCalendarStateService.cs deleted file mode 100644 index cf58b2f3..00000000 --- a/Wino.Calendar/Services/AccountCalendarStateService.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Linq; -using CommunityToolkit.Mvvm.ComponentModel; -using Wino.Calendar.ViewModels.Data; -using Wino.Calendar.ViewModels.Interfaces; -using Wino.Core.Domain.Entities.Shared; - -namespace Wino.Calendar.Services; - -/// -/// Encapsulated state manager for collectively managing the state of account calendars. -/// Callers must react to the events to update their state only from this service. -/// -public partial class AccountCalendarStateService : ObservableObject, IAccountCalendarStateService -{ - public event EventHandler CollectiveAccountGroupSelectionStateChanged; - public event EventHandler AccountCalendarSelectionStateChanged; - - [ObservableProperty] - public partial ReadOnlyObservableCollection GroupedAccountCalendars { get; set; } - - private ObservableCollection _internalGroupedAccountCalendars = new ObservableCollection(); - - public IEnumerable ActiveCalendars - { - get - { - return GroupedAccountCalendars - .SelectMany(a => a.AccountCalendars) - .Where(b => b.IsChecked); - } - } - - public IEnumerable> GroupedAccountCalendarsEnumerable - { - get - { - return GroupedAccountCalendars - .Select(a => a.AccountCalendars) - .SelectMany(b => b) - .GroupBy(c => c.Account); - } - } - - public AccountCalendarStateService() - { - GroupedAccountCalendars = new ReadOnlyObservableCollection(_internalGroupedAccountCalendars); - } - - private void SingleGroupCalendarCollectiveStateChanged(object sender, EventArgs e) - => CollectiveAccountGroupSelectionStateChanged?.Invoke(this, sender as GroupedAccountCalendarViewModel); - - private void SingleCalendarSelectionStateChanged(object sender, AccountCalendarViewModel e) - => AccountCalendarSelectionStateChanged?.Invoke(this, e); - - public void AddGroupedAccountCalendar(GroupedAccountCalendarViewModel groupedAccountCalendar) - { - groupedAccountCalendar.CalendarSelectionStateChanged += SingleCalendarSelectionStateChanged; - groupedAccountCalendar.CollectiveSelectionStateChanged += SingleGroupCalendarCollectiveStateChanged; - - _internalGroupedAccountCalendars.Add(groupedAccountCalendar); - } - - public void RemoveGroupedAccountCalendar(GroupedAccountCalendarViewModel groupedAccountCalendar) - { - groupedAccountCalendar.CalendarSelectionStateChanged -= SingleCalendarSelectionStateChanged; - groupedAccountCalendar.CollectiveSelectionStateChanged -= SingleGroupCalendarCollectiveStateChanged; - - _internalGroupedAccountCalendars.Remove(groupedAccountCalendar); - } - - public void ClearGroupedAccountCalendar() - { - foreach (var groupedAccountCalendar in _internalGroupedAccountCalendars) - { - RemoveGroupedAccountCalendar(groupedAccountCalendar); - } - } - - public void AddAccountCalendar(AccountCalendarViewModel accountCalendar) - { - // Find the group that this calendar belongs to. - var group = _internalGroupedAccountCalendars.FirstOrDefault(g => g.Account.Id == accountCalendar.Account.Id); - - if (group == null) - { - // If the group doesn't exist, create it. - group = new GroupedAccountCalendarViewModel(accountCalendar.Account, new[] { accountCalendar }); - AddGroupedAccountCalendar(group); - } - else - { - group.AccountCalendars.Add(accountCalendar); - } - } - - public void RemoveAccountCalendar(AccountCalendarViewModel accountCalendar) - { - var group = _internalGroupedAccountCalendars.FirstOrDefault(g => g.Account.Id == accountCalendar.Account.Id); - - // We don't expect but just in case. - if (group == null) return; - - group.AccountCalendars.Remove(accountCalendar); - - if (group.AccountCalendars.Count == 0) - { - RemoveGroupedAccountCalendar(group); - } - } -} diff --git a/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs b/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs deleted file mode 100644 index 391ff7f2..00000000 --- a/Wino.Calendar/Services/CalendarAuthenticatorConfig.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Wino.Core.Domain.Interfaces; - -namespace Wino.Calendar.Services; - -public class CalendarAuthenticatorConfig : IAuthenticatorConfig -{ - public string OutlookAuthenticatorClientId => "b19c2035-d740-49ff-b297-de6ec561b208"; - - public string[] OutlookScope => new string[] - { - "Calendars.Read", - "Calendars.Read.Shared", - "offline_access", - "Calendars.ReadBasic", - "Calendars.ReadWrite", - "Calendars.ReadWrite.Shared", - "User.Read" - }; - - public string GmailAuthenticatorClientId => "973025879644-s7b4ur9p3rlgop6a22u7iuptdc0brnrn.apps.googleusercontent.com"; - - public string[] GmailScope => new string[] - { - "https://www.googleapis.com/auth/calendar", - "https://www.googleapis.com/auth/calendar.events", - "https://www.googleapis.com/auth/calendar.settings.readonly", - "https://www.googleapis.com/auth/userinfo.profile", - "https://www.googleapis.com/auth/userinfo.email" - }; - - public string GmailTokenStoreIdentifier => "WinoCalendarGmailTokenStore"; -} diff --git a/Wino.Calendar/Services/DialogService.cs b/Wino.Calendar/Services/DialogService.cs deleted file mode 100644 index 5a8c8965..00000000 --- a/Wino.Calendar/Services/DialogService.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Windows.UI.Xaml; -using Wino.Core.Domain.Interfaces; -using Wino.Core.UWP.Services; - -namespace Wino.Calendar.Services; - -public class DialogService : DialogServiceBase, ICalendarDialogService -{ - public DialogService(IThemeService themeService, - IConfigurationService configurationService, - IApplicationResourceManager applicationResourceManager) : base(themeService, configurationService, applicationResourceManager) - { - } -} diff --git a/Wino.Calendar/Services/NavigationService.cs b/Wino.Calendar/Services/NavigationService.cs deleted file mode 100644 index a6cf340b..00000000 --- a/Wino.Calendar/Services/NavigationService.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Wino.Calendar.Views; -using Wino.Calendar.Views.Account; -using Wino.Calendar.Views.Settings; -using Wino.Core.Domain.Enums; -using Wino.Core.Domain.Interfaces; -using Wino.Core.Domain.Models.Navigation; -using Wino.Core.UWP.Services; -using Wino.Views; - -namespace Wino.Calendar.Services; - -public class NavigationService : NavigationServiceBase, INavigationService -{ - public Type GetPageType(WinoPage winoPage) - { - return winoPage switch - { - WinoPage.CalendarPage => typeof(CalendarPage), - WinoPage.SettingsPage => typeof(SettingsPage), - WinoPage.CalendarSettingsPage => typeof(CalendarSettingsPage), - WinoPage.AccountManagementPage => typeof(AccountManagementPage), - WinoPage.ManageAccountsPage => typeof(ManageAccountsPage), - WinoPage.PersonalizationPage => typeof(PersonalizationPage), - WinoPage.AccountDetailsPage => typeof(AccountDetailsPage), - WinoPage.EventDetailsPage => typeof(EventDetailsPage), - _ => throw new Exception("Page is not implemented yet."), - }; - } - - public void GoBack(Core.Domain.Enums.SlideNavigationTransitionEffect slideEffect = Core.Domain.Enums.SlideNavigationTransitionEffect.FromRight) - { - if (Window.Current.Content is Frame appFrame && appFrame.Content is AppShell shellPage) - { - var shellFrame = shellPage.GetShellFrame(); - - if (shellFrame.CanGoBack) - { - shellFrame.GoBack(); - } - } - } - - public bool Navigate(WinoPage page, object parameter = null, NavigationReferenceFrame frame = NavigationReferenceFrame.ShellFrame, NavigationTransitionType transition = NavigationTransitionType.None) - { - // All navigations are performed on shell frame for calendar. - - if (Window.Current.Content is Frame appFrame && appFrame.Content is AppShell shellPage) - { - var shellFrame = shellPage.GetShellFrame(); - - var pageType = GetPageType(page); - - shellFrame.Navigate(pageType, parameter); - return true; - } - - return false; - } -} diff --git a/Wino.Calendar/Services/ProviderService.cs b/Wino.Calendar/Services/ProviderService.cs deleted file mode 100644 index e0cac8ad..00000000 --- a/Wino.Calendar/Services/ProviderService.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using Wino.Core.Domain.Enums; -using Wino.Core.Domain.Interfaces; -using Wino.Core.Domain.Models.Accounts; - -namespace Wino.Calendar.Services; - -public class ProviderService : IProviderService -{ - public IProviderDetail GetProviderDetail(MailProviderType type) - { - var details = GetAvailableProviders(); - - return details.FirstOrDefault(a => a.Type == type); - } - - public List GetAvailableProviders() - { - var providerList = new List(); - - var providers = new MailProviderType[] - { - MailProviderType.Outlook, - MailProviderType.Gmail - }; - - foreach (var type in providers) - { - providerList.Add(new ProviderDetail(type, SpecialImapProvider.None)); - } - - return providerList; - } -} diff --git a/Wino.Calendar/Styles/CalendarThemeResources.xaml b/Wino.Calendar/Styles/CalendarThemeResources.xaml deleted file mode 100644 index c72bfed6..00000000 --- a/Wino.Calendar/Styles/CalendarThemeResources.xaml +++ /dev/null @@ -1,39 +0,0 @@ - - - - - - - - #b2bec3 - #dfe4ea - #2e86de - - - #2e86de - #dfe4ea - - - #000000 - #000000 - #000000 - - - - - - #525252 - #262626 - #121212 - - - #3d3d3d - #4b4b4b - - - #000000 - #FFFFFF - #000000 - - - diff --git a/Wino.Calendar/Styles/DayHeaderControl.xaml b/Wino.Calendar/Styles/DayHeaderControl.xaml deleted file mode 100644 index 396a0cf0..00000000 --- a/Wino.Calendar/Styles/DayHeaderControl.xaml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - diff --git a/Wino.Calendar/Styles/WinoCalendarResources.xaml b/Wino.Calendar/Styles/WinoCalendarResources.xaml deleted file mode 100644 index 6902dae7..00000000 --- a/Wino.Calendar/Styles/WinoCalendarResources.xaml +++ /dev/null @@ -1,427 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Styles/WinoCalendarResources.xaml.cs b/Wino.Calendar/Styles/WinoCalendarResources.xaml.cs deleted file mode 100644 index fd055e7b..00000000 --- a/Wino.Calendar/Styles/WinoCalendarResources.xaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Windows.UI.Xaml; - -namespace Wino.Calendar.Styles; - -public sealed partial class WinoCalendarResources : ResourceDictionary -{ - public WinoCalendarResources() - { - this.InitializeComponent(); - } -} diff --git a/Wino.Calendar/Styles/WinoCalendarTypeSelectorControl.xaml b/Wino.Calendar/Styles/WinoCalendarTypeSelectorControl.xaml deleted file mode 100644 index a7c374b9..00000000 --- a/Wino.Calendar/Styles/WinoCalendarTypeSelectorControl.xaml +++ /dev/null @@ -1,73 +0,0 @@ - - - - - diff --git a/Wino.Calendar/Styles/WinoCalendarView.xaml b/Wino.Calendar/Styles/WinoCalendarView.xaml deleted file mode 100644 index 8259f570..00000000 --- a/Wino.Calendar/Styles/WinoCalendarView.xaml +++ /dev/null @@ -1,48 +0,0 @@ - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Styles/WinoDayTimelineCanvas.xaml b/Wino.Calendar/Styles/WinoDayTimelineCanvas.xaml deleted file mode 100644 index 96257f2f..00000000 --- a/Wino.Calendar/Styles/WinoDayTimelineCanvas.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - diff --git a/Wino.Calendar/Views/Abstract/AccountDetailsPageAbstract.cs b/Wino.Calendar/Views/Abstract/AccountDetailsPageAbstract.cs deleted file mode 100644 index de113056..00000000 --- a/Wino.Calendar/Views/Abstract/AccountDetailsPageAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Calendar.ViewModels; -using Wino.Core.UWP; - -namespace Wino.Calendar.Views.Abstract; - -public abstract class AccountDetailsPageAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Abstract/AccountManagementPageAbstract.cs b/Wino.Calendar/Views/Abstract/AccountManagementPageAbstract.cs deleted file mode 100644 index e7edd065..00000000 --- a/Wino.Calendar/Views/Abstract/AccountManagementPageAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Calendar.ViewModels; -using Wino.Core.UWP; - -namespace Wino.Calendar.Views.Abstract; - -public partial class AccountManagementPageAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Abstract/AppShellAbstract.cs b/Wino.Calendar/Views/Abstract/AppShellAbstract.cs deleted file mode 100644 index 8ab81b95..00000000 --- a/Wino.Calendar/Views/Abstract/AppShellAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Calendar.ViewModels; -using Wino.Core.UWP; - -namespace Wino.Calendar.Views.Abstract; - -public abstract class AppShellAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Abstract/CalendarPageAbstract.cs b/Wino.Calendar/Views/Abstract/CalendarPageAbstract.cs deleted file mode 100644 index abd1fb5f..00000000 --- a/Wino.Calendar/Views/Abstract/CalendarPageAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Calendar.ViewModels; -using Wino.Core.UWP; - -namespace Wino.Calendar.Views.Abstract; - -public abstract class CalendarPageAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Abstract/CalendarSettingsPageAbstract.cs b/Wino.Calendar/Views/Abstract/CalendarSettingsPageAbstract.cs deleted file mode 100644 index 47eef1d4..00000000 --- a/Wino.Calendar/Views/Abstract/CalendarSettingsPageAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Calendar.ViewModels; -using Wino.Core.UWP; - -namespace Wino.Calendar.Views.Abstract; - -public abstract class CalendarSettingsPageAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Abstract/EventDetailsPageAbstract.cs b/Wino.Calendar/Views/Abstract/EventDetailsPageAbstract.cs deleted file mode 100644 index 9b9df6bb..00000000 --- a/Wino.Calendar/Views/Abstract/EventDetailsPageAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Calendar.ViewModels; -using Wino.Core.UWP; - -namespace Wino.Calendar.Views.Abstract; - -public abstract class EventDetailsPageAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Abstract/PersonalizationPageAbstract.cs b/Wino.Calendar/Views/Abstract/PersonalizationPageAbstract.cs deleted file mode 100644 index b970f09a..00000000 --- a/Wino.Calendar/Views/Abstract/PersonalizationPageAbstract.cs +++ /dev/null @@ -1,6 +0,0 @@ -using Wino.Core.UWP; -using Wino.Core.ViewModels; - -namespace Wino.Calendar.Views.Abstract; - -public partial class PersonalizationPageAbstract : BasePage { } diff --git a/Wino.Calendar/Views/Account/AccountManagementPage.xaml b/Wino.Calendar/Views/Account/AccountManagementPage.xaml deleted file mode 100644 index 636a25df..00000000 --- a/Wino.Calendar/Views/Account/AccountManagementPage.xaml +++ /dev/null @@ -1,179 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Views/Account/AccountManagementPage.xaml.cs b/Wino.Calendar/Views/Account/AccountManagementPage.xaml.cs deleted file mode 100644 index 4e63cca5..00000000 --- a/Wino.Calendar/Views/Account/AccountManagementPage.xaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Wino.Calendar.Views.Abstract; - -namespace Wino.Calendar.Views.Account; - -public sealed partial class AccountManagementPage : AccountManagementPageAbstract -{ - public AccountManagementPage() - { - InitializeComponent(); - } -} diff --git a/Wino.Calendar/Views/AppShell.xaml b/Wino.Calendar/Views/AppShell.xaml deleted file mode 100644 index 19ca397c..00000000 --- a/Wino.Calendar/Views/AppShell.xaml +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Views/Settings/AccountDetailsPage.xaml.cs b/Wino.Calendar/Views/Settings/AccountDetailsPage.xaml.cs deleted file mode 100644 index 0cb918b0..00000000 --- a/Wino.Calendar/Views/Settings/AccountDetailsPage.xaml.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Wino.Calendar.Views.Abstract; - -namespace Wino.Calendar.Views.Settings; - -public sealed partial class AccountDetailsPage : AccountDetailsPageAbstract -{ - public AccountDetailsPage() - { - this.InitializeComponent(); - } -} diff --git a/Wino.Calendar/Views/Settings/CalendarSettingsPage.xaml b/Wino.Calendar/Views/Settings/CalendarSettingsPage.xaml deleted file mode 100644 index 7254969f..00000000 --- a/Wino.Calendar/Views/Settings/CalendarSettingsPage.xaml +++ /dev/null @@ -1,200 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Wino.Calendar/Views/Settings/CalendarSettingsPage.xaml.cs b/Wino.Calendar/Views/Settings/CalendarSettingsPage.xaml.cs deleted file mode 100644 index 1114ea5d..00000000 --- a/Wino.Calendar/Views/Settings/CalendarSettingsPage.xaml.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Wino.Calendar.Views.Abstract; - - -namespace Wino.Calendar.Views.Settings; - -public sealed partial class CalendarSettingsPage : CalendarSettingsPageAbstract -{ - public CalendarSettingsPage() - { - InitializeComponent(); - } -} diff --git a/Wino.Calendar/Views/Settings/PersonalizationPage.xaml b/Wino.Calendar/Views/Settings/PersonalizationPage.xaml deleted file mode 100644 index 0a66743a..00000000 --- a/Wino.Calendar/Views/Settings/PersonalizationPage.xaml +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -