From 1209796099e685515bc0cc0a98482aa46f5619a9 Mon Sep 17 00:00:00 2001 From: TheJoKlLa Date: Mon, 25 Jan 2021 22:48:41 +0100 Subject: [PATCH] Added: ListView Template --- Borepin/Borepin/App.xaml.cs | 10 +++- Borepin/Borepin/Borepin.csproj | 16 +++++- Borepin/Borepin/Model/ListItem.cs | 7 +++ Borepin/Borepin/Page/BFFHInstancesPage.xaml | 18 ++++++ ...Page.xaml.cs => BFFHInstancesPage.xaml.cs} | 4 +- Borepin/Borepin/Page/ListPage.xaml | 19 +++++++ Borepin/Borepin/Page/ListPage.xaml.cs | 20 +++++++ Borepin/Borepin/Page/MainPage.xaml | 2 +- Borepin/Borepin/Page/ServerInstancesPage.xaml | 12 ---- ...PageModel.cs => BFFHInstancesPageModel.cs} | 4 +- Borepin/Borepin/PageModel/ListPageModel.cs | 57 +++++++++++++++++++ ...stView.xaml => BFFHInstanceEntryView.xaml} | 4 +- .../View/BFFHInstanceEntryView.xaml.cs | 20 +++++++ Borepin/Borepin/View/ListItemView.xaml | 12 ++++ ...{HostView.xaml.cs => ListItemView.xaml.cs} | 4 +- .../ViewModel/BFFHInstanceEntryViewModel.cs | 20 +++++++ Borepin/Borepin/ViewModel/HostViewModel.cs | 12 ---- .../Borepin/ViewModel/ListItemViewModel.cs | 20 +++++++ 18 files changed, 224 insertions(+), 37 deletions(-) create mode 100644 Borepin/Borepin/Model/ListItem.cs create mode 100644 Borepin/Borepin/Page/BFFHInstancesPage.xaml rename Borepin/Borepin/Page/{ServerInstancesPage.xaml.cs => BFFHInstancesPage.xaml.cs} (76%) create mode 100644 Borepin/Borepin/Page/ListPage.xaml create mode 100644 Borepin/Borepin/Page/ListPage.xaml.cs delete mode 100644 Borepin/Borepin/Page/ServerInstancesPage.xaml rename Borepin/Borepin/PageModel/{ServerInstancesPageModel.cs => BFFHInstancesPageModel.cs} (84%) create mode 100644 Borepin/Borepin/PageModel/ListPageModel.cs rename Borepin/Borepin/View/{HostView.xaml => BFFHInstanceEntryView.xaml} (68%) create mode 100644 Borepin/Borepin/View/BFFHInstanceEntryView.xaml.cs create mode 100644 Borepin/Borepin/View/ListItemView.xaml rename Borepin/Borepin/View/{HostView.xaml.cs => ListItemView.xaml.cs} (79%) create mode 100644 Borepin/Borepin/ViewModel/BFFHInstanceEntryViewModel.cs delete mode 100644 Borepin/Borepin/ViewModel/HostViewModel.cs create mode 100644 Borepin/Borepin/ViewModel/ListItemViewModel.cs diff --git a/Borepin/Borepin/App.xaml.cs b/Borepin/Borepin/App.xaml.cs index 4e3cb66..acd86d9 100644 --- a/Borepin/Borepin/App.xaml.cs +++ b/Borepin/Borepin/App.xaml.cs @@ -5,6 +5,8 @@ using Borepin.Page; using Xamarin.Forms; using Borepin.Service; using Borepin.Service.ServerInstances; +using Borepin.View; +using Borepin.ViewModel; namespace Borepin { @@ -19,7 +21,8 @@ namespace Borepin { InitializeComponent(); - var result = await NavigationService.NavigateAsync("/NavigationPage/HostSelectPage"); + //var result = await NavigationService.NavigateAsync("/NavigationPage/HostSelectPage"); + var result = await NavigationService.NavigateAsync("/ListPage"); if (!result.Success) { @@ -37,7 +40,10 @@ namespace Borepin containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); - containerRegistry.RegisterForNavigation(); + containerRegistry.RegisterForNavigation(); + + containerRegistry.RegisterForNavigation(); + BFFHInstanceService bffhInstanceService = new BFFHInstanceService(); diff --git a/Borepin/Borepin/Borepin.csproj b/Borepin/Borepin/Borepin.csproj index 7673c6f..53338fd 100644 --- a/Borepin/Borepin/Borepin.csproj +++ b/Borepin/Borepin/Borepin.csproj @@ -31,6 +31,9 @@ MachinesPage.xaml + + BFFHInstancesPage.xaml + SettingsPage.xaml @@ -47,11 +50,17 @@ LightTheme.xaml + + BFFHInstanceEntryView.xaml + MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml + MSBuild:UpdateDesignTimeXaml @@ -67,7 +76,7 @@ MSBuild:UpdateDesignTimeXaml - + MSBuild:UpdateDesignTimeXaml @@ -84,7 +93,10 @@ MSBuild:UpdateDesignTimeXaml - + + MSBuild:UpdateDesignTimeXaml + + MSBuild:UpdateDesignTimeXaml diff --git a/Borepin/Borepin/Model/ListItem.cs b/Borepin/Borepin/Model/ListItem.cs new file mode 100644 index 0000000..6410fc8 --- /dev/null +++ b/Borepin/Borepin/Model/ListItem.cs @@ -0,0 +1,7 @@ +namespace Borepin.Model +{ + public class ListItem + { + public string Value1 { get; set; } + } +} diff --git a/Borepin/Borepin/Page/BFFHInstancesPage.xaml b/Borepin/Borepin/Page/BFFHInstancesPage.xaml new file mode 100644 index 0000000..aaa97e1 --- /dev/null +++ b/Borepin/Borepin/Page/BFFHInstancesPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Borepin/Borepin/Page/ServerInstancesPage.xaml.cs b/Borepin/Borepin/Page/BFFHInstancesPage.xaml.cs similarity index 76% rename from Borepin/Borepin/Page/ServerInstancesPage.xaml.cs rename to Borepin/Borepin/Page/BFFHInstancesPage.xaml.cs index 04df04e..00533dc 100644 --- a/Borepin/Borepin/Page/ServerInstancesPage.xaml.cs +++ b/Borepin/Borepin/Page/BFFHInstancesPage.xaml.cs @@ -10,9 +10,9 @@ using Xamarin.Forms.Xaml; namespace Borepin.Page { [XamlCompilation(XamlCompilationOptions.Compile)] - public partial class ServerInstancesPage : ContentPage + public partial class BFFHInstancesPage : ContentPage { - public ServerInstancesPage() + public BFFHInstancesPage() { InitializeComponent(); } diff --git a/Borepin/Borepin/Page/ListPage.xaml b/Borepin/Borepin/Page/ListPage.xaml new file mode 100644 index 0000000..b649e6b --- /dev/null +++ b/Borepin/Borepin/Page/ListPage.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Borepin/Borepin/Page/ListPage.xaml.cs b/Borepin/Borepin/Page/ListPage.xaml.cs new file mode 100644 index 0000000..cadb3dc --- /dev/null +++ b/Borepin/Borepin/Page/ListPage.xaml.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace Borepin.Page +{ + [XamlCompilation(XamlCompilationOptions.Compile)] + public partial class ListPage : ContentPage + { + public ListPage() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/Borepin/Borepin/Page/MainPage.xaml b/Borepin/Borepin/Page/MainPage.xaml index 48d67aa..84ae416 100644 --- a/Borepin/Borepin/Page/MainPage.xaml +++ b/Borepin/Borepin/Page/MainPage.xaml @@ -9,7 +9,7 @@