From 1a97a81938f5437446a21fd788a4f1b7fa02f483 Mon Sep 17 00:00:00 2001 From: Sathish-087 Date: Fri, 18 Oct 2024 19:00:56 +0530 Subject: [PATCH] Address review comments --- .../GettingStarted/GettingStarted/App.xaml.cs | 2 +- .../GettingStarted/AppShell.xaml | 15 -- .../GettingStarted/AppShell.xaml.cs | 10 -- .../GettingStarted/GettingStarted/App.xaml.cs | 2 +- .../GettingStarted/AppShell.xaml | 15 -- .../GettingStarted/AppShell.xaml.cs | 10 -- .../Behavior/GettingStartedBehavior.cs | 144 ++++++++++++++++++ .../GettingStarted/MainPage.xaml | 63 ++++---- .../GettingStarted/MainPage.xaml.cs | 31 +--- .../GettingStarted/ViewModel/ListViewModel.cs | 24 +++ .../GettingStarted/GettingStarted/App.xaml.cs | 2 +- .../GettingStarted/AppShell.xaml | 15 -- .../GettingStarted/AppShell.xaml.cs | 10 -- 13 files changed, 205 insertions(+), 138 deletions(-) delete mode 100644 EffectsView/GettingStarted/GettingStarted/AppShell.xaml delete mode 100644 EffectsView/GettingStarted/GettingStarted/AppShell.xaml.cs delete mode 100644 NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml delete mode 100644 NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml.cs create mode 100644 NavigationDrawer/GettingStarted/GettingStarted/Behavior/GettingStartedBehavior.cs create mode 100644 NavigationDrawer/GettingStarted/GettingStarted/ViewModel/ListViewModel.cs delete mode 100644 SegmentedControl/GettingStarted/GettingStarted/AppShell.xaml delete mode 100644 SegmentedControl/GettingStarted/GettingStarted/AppShell.xaml.cs diff --git a/EffectsView/GettingStarted/GettingStarted/App.xaml.cs b/EffectsView/GettingStarted/GettingStarted/App.xaml.cs index 9758931..3183fef 100644 --- a/EffectsView/GettingStarted/GettingStarted/App.xaml.cs +++ b/EffectsView/GettingStarted/GettingStarted/App.xaml.cs @@ -6,7 +6,7 @@ public App() { InitializeComponent(); - MainPage = new AppShell(); + MainPage = new MainPage(); } } } diff --git a/EffectsView/GettingStarted/GettingStarted/AppShell.xaml b/EffectsView/GettingStarted/GettingStarted/AppShell.xaml deleted file mode 100644 index 8947f53..0000000 --- a/EffectsView/GettingStarted/GettingStarted/AppShell.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/EffectsView/GettingStarted/GettingStarted/AppShell.xaml.cs b/EffectsView/GettingStarted/GettingStarted/AppShell.xaml.cs deleted file mode 100644 index b9c11f5..0000000 --- a/EffectsView/GettingStarted/GettingStarted/AppShell.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace GettingStarted -{ - public partial class AppShell : Shell - { - public AppShell() - { - InitializeComponent(); - } - } -} diff --git a/NavigationDrawer/GettingStarted/GettingStarted/App.xaml.cs b/NavigationDrawer/GettingStarted/GettingStarted/App.xaml.cs index 9758931..3183fef 100644 --- a/NavigationDrawer/GettingStarted/GettingStarted/App.xaml.cs +++ b/NavigationDrawer/GettingStarted/GettingStarted/App.xaml.cs @@ -6,7 +6,7 @@ public App() { InitializeComponent(); - MainPage = new AppShell(); + MainPage = new MainPage(); } } } diff --git a/NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml b/NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml deleted file mode 100644 index 8947f53..0000000 --- a/NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - diff --git a/NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml.cs b/NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml.cs deleted file mode 100644 index b9c11f5..0000000 --- a/NavigationDrawer/GettingStarted/GettingStarted/AppShell.xaml.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace GettingStarted -{ - public partial class AppShell : Shell - { - public AppShell() - { - InitializeComponent(); - } - } -} diff --git a/NavigationDrawer/GettingStarted/GettingStarted/Behavior/GettingStartedBehavior.cs b/NavigationDrawer/GettingStarted/GettingStarted/Behavior/GettingStartedBehavior.cs new file mode 100644 index 0000000..8301458 --- /dev/null +++ b/NavigationDrawer/GettingStarted/GettingStarted/Behavior/GettingStartedBehavior.cs @@ -0,0 +1,144 @@ +namespace GettingStarted +{ + using Syncfusion.Maui.Toolkit.NavigationDrawer; + + /// + /// Getting started behavior class. + /// + public class GettingStartedBehavior : Behavior + { + /// + /// Navigation drawer instance. + /// + private SfNavigationDrawer? navigationDrawer; + + /// + /// Image button instance. + /// + private ImageButton? imageButton; + + /// + /// List view instance. + /// + private ListView? listView; + + /// + /// Label instance. + /// + private Label? contentLabel; + + /// + /// Instance of the list view model. + /// + private ListViewModel listViewModel = new ListViewModel(); + + /// + /// Called when the behavior is attached to a content page. + /// + /// The content page. + protected override void OnAttachedTo(ContentPage bindable) + { + base.OnAttachedTo(bindable); + bindable.Appearing += Bindable_Appearing; + } + + /// + /// Handles the appearing event of the content page. + /// + /// The event sender. + /// The event arguments. + private void Bindable_Appearing(object? sender, EventArgs e) + { + var page = sender as ContentPage; + if (page == null) + { + return; + } + + this.navigationDrawer = page.Content.FindByName("navigationDrawer"); + this.imageButton = page.Content.FindByName("hamburgerButton"); + this.listView = page.Content.FindByName("listView"); + this.contentLabel = page.Content.FindByName