From 11f1e206b8251b913098fa8b69ec14bd19a4a4ea Mon Sep 17 00:00:00 2001 From: Julia Date: Thu, 13 Mar 2025 11:30:05 +0300 Subject: [PATCH] first commit --- .gitignore | 3 + App.xaml | 32 +++++++++ App.xaml.cs | 32 +++++++++ AppShell.xaml | 136 ++++++++++++++++++++++++++++++++++++++ AppShell.xaml.cs | 23 +++++++ AssemblyInfo.cs | 3 + GettingStarted.txt | 34 ++++++++++ Models/Item.cs | 11 +++ MyMobileApp.csproj | 22 ++++++ SecondPage.xaml | 18 +++++ SecondPage.xaml.cs | 25 +++++++ Services/IDataStore.cs | 15 +++++ Services/MockDataStore.cs | 60 +++++++++++++++++ SignIn.xaml | 84 +++++++++++++++++++++++ SignIn.xaml.cs | 25 +++++++ ViewModels/AboutViewModel.cs | 18 +++++ ViewModels/BaseViewModel.cs | 54 +++++++++++++++ ViewModels/ItemDetailViewModel.cs | 57 ++++++++++++++++ ViewModels/ItemsViewModel.cs | 84 +++++++++++++++++++++++ ViewModels/LoginViewModel.cs | 24 +++++++ ViewModels/NewItemViewModel.cs | 65 ++++++++++++++++++ Views/AboutPage.xaml | 52 +++++++++++++++ Views/AboutPage.xaml.cs | 15 +++++ Views/ItemDetailPage.xaml | 14 ++++ Views/ItemDetailPage.xaml.cs | 15 +++++ Views/ItemsPage.xaml | 44 ++++++++++++ Views/ItemsPage.xaml.cs | 32 +++++++++ Views/LoginPage.xaml | 14 ++++ Views/LoginPage.xaml.cs | 21 ++++++ Views/NewItemPage.xaml | 22 ++++++ Views/NewItemPage.xaml.cs | 21 ++++++ 31 files changed, 1075 insertions(+) create mode 100644 .gitignore create mode 100644 App.xaml create mode 100644 App.xaml.cs create mode 100644 AppShell.xaml create mode 100644 AppShell.xaml.cs create mode 100644 AssemblyInfo.cs create mode 100644 GettingStarted.txt create mode 100644 Models/Item.cs create mode 100644 MyMobileApp.csproj create mode 100644 SecondPage.xaml create mode 100644 SecondPage.xaml.cs create mode 100644 Services/IDataStore.cs create mode 100644 Services/MockDataStore.cs create mode 100644 SignIn.xaml create mode 100644 SignIn.xaml.cs create mode 100644 ViewModels/AboutViewModel.cs create mode 100644 ViewModels/BaseViewModel.cs create mode 100644 ViewModels/ItemDetailViewModel.cs create mode 100644 ViewModels/ItemsViewModel.cs create mode 100644 ViewModels/LoginViewModel.cs create mode 100644 ViewModels/NewItemViewModel.cs create mode 100644 Views/AboutPage.xaml create mode 100644 Views/AboutPage.xaml.cs create mode 100644 Views/ItemDetailPage.xaml create mode 100644 Views/ItemDetailPage.xaml.cs create mode 100644 Views/ItemsPage.xaml create mode 100644 Views/ItemsPage.xaml.cs create mode 100644 Views/LoginPage.xaml create mode 100644 Views/LoginPage.xaml.cs create mode 100644 Views/NewItemPage.xaml create mode 100644 Views/NewItemPage.xaml.cs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5df6da6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +/.vs +/bin +/obj \ No newline at end of file diff --git a/App.xaml b/App.xaml new file mode 100644 index 0000000..a92008a --- /dev/null +++ b/App.xaml @@ -0,0 +1,32 @@ + + + + + + #2196F3 + + + + diff --git a/App.xaml.cs b/App.xaml.cs new file mode 100644 index 0000000..5064681 --- /dev/null +++ b/App.xaml.cs @@ -0,0 +1,32 @@ +using MyMobileApp.Services; +using MyMobileApp.Views; +using System; +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace MyMobileApp +{ + public partial class App : Application + { + + public App() + { + InitializeComponent(); + + DependencyService.Register(); + MainPage = new SignIn(); + } + + protected override void OnStart() + { + } + + protected override void OnSleep() + { + } + + protected override void OnResume() + { + } + } +} diff --git a/AppShell.xaml b/AppShell.xaml new file mode 100644 index 0000000..7ce84a3 --- /dev/null +++ b/AppShell.xaml @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/AppShell.xaml.cs b/AppShell.xaml.cs new file mode 100644 index 0000000..64b5a1e --- /dev/null +++ b/AppShell.xaml.cs @@ -0,0 +1,23 @@ +using MyMobileApp.ViewModels; +using MyMobileApp.Views; +using System; +using System.Collections.Generic; +using Xamarin.Forms; + +namespace MyMobileApp +{ + public partial class AppShell : Xamarin.Forms.Shell + { + public AppShell() + { + InitializeComponent(); + Routing.RegisterRoute(nameof(ItemDetailPage), typeof(ItemDetailPage)); + Routing.RegisterRoute(nameof(NewItemPage), typeof(NewItemPage)); + } + + private async void OnMenuItemClicked(object sender, EventArgs e) + { + await Shell.Current.GoToAsync("//LoginPage"); + } + } +} diff --git a/AssemblyInfo.cs b/AssemblyInfo.cs new file mode 100644 index 0000000..c859952 --- /dev/null +++ b/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Xamarin.Forms.Xaml; + +[assembly: XamlCompilation(XamlCompilationOptions.Compile)] \ No newline at end of file diff --git a/GettingStarted.txt b/GettingStarted.txt new file mode 100644 index 0000000..411f64b --- /dev/null +++ b/GettingStarted.txt @@ -0,0 +1,34 @@ +Welcome to Xamarin.Forms! Here are some tips to get started building your app. + +Building Your App UI +-------------------- + +XAML Hot Reload quickly applies UI changes as you make them to your running app. +This is the most productive way to preview and iteratively create your UI. + +Try it out: + +1. Run the app by clicking the Start Debugging (play) button in the above toolbar. +2. Open \Views\AboutPage.xaml. + Don't stop the app - keep it running while making changes. +3. Change something! Hint: change the Accent color on line 14 from "#96d1ff" to "Pink". +4. Watch the About screen update on the device or emulator, with the logo background now pink. + +Keep going and try more changes! + +QuickStart Guide +---------------- + +Learn more of the fundamentals for building apps with Xamarin here: https://aka.ms/xamarin-quickstart + +Your App Shell +-------------- + +This template uses Shell, an app container that reduces the complexity of your apps by providing fundamental features including: + +- A single place to describe the app's visual hierarchy. +- Common navigation such as a flyout menu and tabs. +- A URI-based navigation scheme that permits navigation to any page in the application. +- An integrated search handler. + +Open AppShell.xaml to begin exploring. To learn more about Shell visit: https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/introduction diff --git a/Models/Item.cs b/Models/Item.cs new file mode 100644 index 0000000..966ff33 --- /dev/null +++ b/Models/Item.cs @@ -0,0 +1,11 @@ +using System; + +namespace MyMobileApp.Models +{ + public class Item + { + public string Id { get; set; } + public string Text { get; set; } + public string Description { get; set; } + } +} \ No newline at end of file diff --git a/MyMobileApp.csproj b/MyMobileApp.csproj new file mode 100644 index 0000000..d885792 --- /dev/null +++ b/MyMobileApp.csproj @@ -0,0 +1,22 @@ + + + + netstandard2.0 + true + true + + + + + + + + + + MSBuild:UpdateDesignTimeXaml + + + MSBuild:UpdateDesignTimeXaml + + + \ No newline at end of file diff --git a/SecondPage.xaml b/SecondPage.xaml new file mode 100644 index 0000000..22a6881 --- /dev/null +++ b/SecondPage.xaml @@ -0,0 +1,18 @@ + + + + + + + + + + + diff --git a/Views/NewItemPage.xaml.cs b/Views/NewItemPage.xaml.cs new file mode 100644 index 0000000..4c78113 --- /dev/null +++ b/Views/NewItemPage.xaml.cs @@ -0,0 +1,21 @@ +using MyMobileApp.Models; +using MyMobileApp.ViewModels; +using System; +using System.Collections.Generic; +using System.ComponentModel; +using Xamarin.Forms; +using Xamarin.Forms.Xaml; + +namespace MyMobileApp.Views +{ + public partial class NewItemPage : ContentPage + { + public Item Item { get; set; } + + public NewItemPage() + { + InitializeComponent(); + BindingContext = new NewItemViewModel(); + } + } +} \ No newline at end of file