From 47942428f34a08194eb0ec5ae0c0a890218bab7d Mon Sep 17 00:00:00 2001 From: MykhailoDav Date: Fri, 3 Jan 2025 21:07:47 +0200 Subject: [PATCH 1/3] added AppShell --- samples/SampleApp/App.xaml.cs | 10 +- samples/SampleApp/AppShell.xaml | 35 ++++++ samples/SampleApp/AppShell.xaml.cs | 21 ++++ samples/SampleApp/Controls/ThemeButton.xaml | 4 +- samples/SampleApp/Views/AdvancedPage.xaml | 41 ++++--- .../Windows11CalendarPage.xaml | 22 ++-- samples/SampleApp/Views/MainPage.xaml | 110 +++++++++--------- samples/SampleApp/Views/MainPage.xaml.cs | 24 ++-- .../SampleApp/Views/MultiSelectionPage.xaml | 40 ++++--- .../SampleApp/Views/RangeSelectionPage.xaml | 20 ++-- samples/SampleApp/Views/SimplePage.xaml | 1 + samples/SampleApp/Views/TwoWeekViewPage.xaml | 15 ++- samples/SampleApp/Views/WeekViewPage.xaml | 15 ++- .../SampleApp/Views/WeekendCalendarPage.xaml | 38 ++++-- 14 files changed, 253 insertions(+), 143 deletions(-) create mode 100644 samples/SampleApp/AppShell.xaml create mode 100644 samples/SampleApp/AppShell.xaml.cs diff --git a/samples/SampleApp/App.xaml.cs b/samples/SampleApp/App.xaml.cs index 1c391d9..348ba76 100644 --- a/samples/SampleApp/App.xaml.cs +++ b/samples/SampleApp/App.xaml.cs @@ -10,23 +10,23 @@ public partial class App : Application public static new App Current => (App)Application.Current; public App(IThemeService themeService) - { + { this.themeService = themeService; InitializeComponent(); - MainPage = new NavigationPage(new MainPage()); + MainPage = new AppShell(); } - + protected override void OnStart() { themeService.SetTheme(AppTheme.Unspecified); - } + } protected override void OnResume() { } - + } diff --git a/samples/SampleApp/AppShell.xaml b/samples/SampleApp/AppShell.xaml new file mode 100644 index 0000000..4a7389e --- /dev/null +++ b/samples/SampleApp/AppShell.xaml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/SampleApp/AppShell.xaml.cs b/samples/SampleApp/AppShell.xaml.cs new file mode 100644 index 0000000..0664acd --- /dev/null +++ b/samples/SampleApp/AppShell.xaml.cs @@ -0,0 +1,21 @@ +using SampleApp.Views; + +namespace SampleApp; + +public partial class AppShell : Shell +{ + public AppShell() + { + InitializeComponent(); + + Routing.RegisterRoute(nameof(UserSettingPage), typeof(UserSettingPage)); + Routing.RegisterRoute(nameof(SimplePage), typeof(SimplePage)); + Routing.RegisterRoute(nameof(WeekendCalendarPage), typeof(WeekendCalendarPage)); + Routing.RegisterRoute(nameof(MultiSelectionPage), typeof(MultiSelectionPage)); + Routing.RegisterRoute(nameof(AdvancedPage), typeof(AdvancedPage)); + Routing.RegisterRoute(nameof(RangeSelectionPage), typeof(RangeSelectionPage)); + Routing.RegisterRoute(nameof(WeekViewPage), typeof(WeekViewPage)); + Routing.RegisterRoute(nameof(TwoWeekViewPage), typeof(TwoWeekViewPage)); + Routing.RegisterRoute(nameof(Windows11CalendarPage), typeof(Windows11CalendarPage)); + } +} \ No newline at end of file diff --git a/samples/SampleApp/Controls/ThemeButton.xaml b/samples/SampleApp/Controls/ThemeButton.xaml index efc9454..cbafe9b 100644 --- a/samples/SampleApp/Controls/ThemeButton.xaml +++ b/samples/SampleApp/Controls/ThemeButton.xaml @@ -19,11 +19,11 @@ + Light="#2F3E46" /> + Light="#c2c5aa" /> diff --git a/samples/SampleApp/Views/AdvancedPage.xaml b/samples/SampleApp/Views/AdvancedPage.xaml index 9a6e3fe..4d899e6 100644 --- a/samples/SampleApp/Views/AdvancedPage.xaml +++ b/samples/SampleApp/Views/AdvancedPage.xaml @@ -8,28 +8,39 @@ xmlns:plugin="clr-namespace:Plugin.Maui.Calendar.Controls;assembly=Plugin.Maui.Calendar" xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" x:Name="advancedCalendarPage" + Shell.TabBarIsVisible="False" x:DataType="local:AdvancedPageViewModel" BackgroundColor="{toolkit:AppThemeResource BackgroundColor}" Unloaded="UnloadedHandler"> - - - + @@ -77,18 +88,18 @@ YearLabelColor="Blue"> - + - + - + @@ -97,7 +108,7 @@ diff --git a/samples/SampleApp/Views/DefaultDeviceCalendars/Windows11CalendarPage.xaml b/samples/SampleApp/Views/DefaultDeviceCalendars/Windows11CalendarPage.xaml index 029ec12..c2e30ea 100644 --- a/samples/SampleApp/Views/DefaultDeviceCalendars/Windows11CalendarPage.xaml +++ b/samples/SampleApp/Views/DefaultDeviceCalendars/Windows11CalendarPage.xaml @@ -8,6 +8,7 @@ xmlns:plugin="clr-namespace:Plugin.Maui.Calendar.Controls;assembly=Plugin.Maui.Calendar" xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit" x:Name="windowsCalendarPage" + Shell.TabBarIsVisible="False" Title="Windows 11 Calendar" x:DataType="local:Windows11CalendarViewModel"> @@ -16,28 +17,31 @@ + Light="#2b9348"/> + Light="White"/> - - + - + + Offset="0,4"/> - + diff --git a/samples/SampleApp/Views/MainPage.xaml b/samples/SampleApp/Views/MainPage.xaml index 09ab7b5..e518cc1 100644 --- a/samples/SampleApp/Views/MainPage.xaml +++ b/samples/SampleApp/Views/MainPage.xaml @@ -10,109 +10,113 @@ android:NavigationBar.Color="{toolkit:AppThemeResource BackgroundColorfullPageColor}" BackgroundColor="{toolkit:AppThemeResource BackgroundColorfullPageColor}" Shell.BackgroundColor="{toolkit:AppThemeResource BackgroundColorfullPageColor}" - Shell.TitleColor="{toolkit:AppThemeResource DaysTitleLabelTextColor}"> - - - - - - - - + Shell.TitleColor="{toolkit:AppThemeResource TextColor}"> - - + Light="#000000"/> + Light="#000000"/> - - - +