base xamarin form

main
syneffort 2 years ago
parent c0548e4a32
commit 77a196d8f9
  1. 103
      XamarinStudy/XamarinStudy.sln
  2. 19
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Assets/AboutAssets.txt
  3. 28
      XamarinStudy/XamarinStudy/XamarinStudy.Android/MainActivity.cs
  4. 6
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Properties/AndroidManifest.xml
  5. 30
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Properties/AssemblyInfo.cs
  6. 50
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/AboutResources.txt
  7. 29665
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/Resource.designer.cs
  8. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/drawable/icon_about.png
  9. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/drawable/icon_feed.png
  10. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/drawable/xamarin_logo.png
  11. 5
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-anydpi-v26/icon.xml
  12. 5
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-anydpi-v26/icon_round.xml
  13. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-hdpi/icon.png
  14. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-hdpi/launcher_foreground.png
  15. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-mdpi/icon.png
  16. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-mdpi/launcher_foreground.png
  17. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-xhdpi/icon.png
  18. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-xhdpi/launcher_foreground.png
  19. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-xxhdpi/icon.png
  20. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
  21. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-xxxhdpi/icon.png
  22. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
  23. 7
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/values/colors.xml
  24. 18
      XamarinStudy/XamarinStudy/XamarinStudy.Android/Resources/values/styles.xml
  25. 96
      XamarinStudy/XamarinStudy/XamarinStudy.Android/XamarinStudy.Android.csproj
  26. 7
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/App.xaml
  27. 106
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/App.xaml.cs
  28. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/LargeTile.scale-100.png
  29. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/LargeTile.scale-200.png
  30. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/LargeTile.scale-400.png
  31. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/SmallTile.scale-100.png
  32. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/SmallTile.scale-200.png
  33. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/SmallTile.scale-400.png
  34. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/SplashScreen.scale-100.png
  35. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/SplashScreen.scale-200.png
  36. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/SplashScreen.scale-400.png
  37. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square150x150Logo.scale-100.png
  38. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square150x150Logo.scale-200.png
  39. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square150x150Logo.scale-400.png
  40. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
  41. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
  42. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
  43. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.scale-100.png
  44. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.scale-200.png
  45. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.scale-400.png
  46. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.targetsize-16.png
  47. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.targetsize-256.png
  48. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Square44x44Logo.targetsize-48.png
  49. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/StoreLogo.backup.png
  50. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/StoreLogo.scale-100.png
  51. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/StoreLogo.scale-200.png
  52. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/StoreLogo.scale-400.png
  53. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Wide310x150Logo.scale-100.png
  54. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Wide310x150Logo.scale-200.png
  55. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Assets/Wide310x150Logo.scale-400.png
  56. 12
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/MainPage.xaml
  57. 27
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/MainPage.xaml.cs
  58. 55
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Package.appxmanifest
  59. 29
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Properties/AssemblyInfo.cs
  60. 31
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/Properties/Default.rd.xml
  61. 164
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/XamarinStudy.UWP.csproj
  62. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/icon_about.png
  63. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/icon_feed.png
  64. BIN
      XamarinStudy/XamarinStudy/XamarinStudy.UWP/xamarin_logo.png
  65. 32
      XamarinStudy/XamarinStudy/XamarinStudy/App.xaml
  66. 32
      XamarinStudy/XamarinStudy/XamarinStudy/App.xaml.cs
  67. 136
      XamarinStudy/XamarinStudy/XamarinStudy/AppShell.xaml
  68. 23
      XamarinStudy/XamarinStudy/XamarinStudy/AppShell.xaml.cs
  69. 3
      XamarinStudy/XamarinStudy/XamarinStudy/AssemblyInfo.cs
  70. 34
      XamarinStudy/XamarinStudy/XamarinStudy/GettingStarted.txt
  71. 11
      XamarinStudy/XamarinStudy/XamarinStudy/Models/Item.cs
  72. 15
      XamarinStudy/XamarinStudy/XamarinStudy/Services/IDataStore.cs
  73. 60
      XamarinStudy/XamarinStudy/XamarinStudy/Services/MockDataStore.cs
  74. 18
      XamarinStudy/XamarinStudy/XamarinStudy/ViewModels/AboutViewModel.cs
  75. 56
      XamarinStudy/XamarinStudy/XamarinStudy/ViewModels/BaseViewModel.cs
  76. 57
      XamarinStudy/XamarinStudy/XamarinStudy/ViewModels/ItemDetailViewModel.cs
  77. 86
      XamarinStudy/XamarinStudy/XamarinStudy/ViewModels/ItemsViewModel.cs
  78. 24
      XamarinStudy/XamarinStudy/XamarinStudy/ViewModels/LoginViewModel.cs
  79. 65
      XamarinStudy/XamarinStudy/XamarinStudy/ViewModels/NewItemViewModel.cs
  80. 52
      XamarinStudy/XamarinStudy/XamarinStudy/Views/AboutPage.xaml
  81. 15
      XamarinStudy/XamarinStudy/XamarinStudy/Views/AboutPage.xaml.cs
  82. 14
      XamarinStudy/XamarinStudy/XamarinStudy/Views/ItemDetailPage.xaml
  83. 15
      XamarinStudy/XamarinStudy/XamarinStudy/Views/ItemDetailPage.xaml.cs
  84. 44
      XamarinStudy/XamarinStudy/XamarinStudy/Views/ItemsPage.xaml
  85. 32
      XamarinStudy/XamarinStudy/XamarinStudy/Views/ItemsPage.xaml.cs
  86. 14
      XamarinStudy/XamarinStudy/XamarinStudy/Views/LoginPage.xaml
  87. 21
      XamarinStudy/XamarinStudy/XamarinStudy/Views/LoginPage.xaml.cs
  88. 22
      XamarinStudy/XamarinStudy/XamarinStudy/Views/NewItemPage.xaml
  89. 22
      XamarinStudy/XamarinStudy/XamarinStudy/Views/NewItemPage.xaml.cs
  90. 12
      XamarinStudy/XamarinStudy/XamarinStudy/XamarinStudy.csproj

@ -0,0 +1,103 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32929.385
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinStudy.UWP", "XamarinStudy\XamarinStudy.UWP\XamarinStudy.UWP.csproj", "{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinStudy.Android", "XamarinStudy\XamarinStudy.Android\XamarinStudy.Android.csproj", "{085DC5E8-F22B-4E22-9762-AF0AF8973776}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "XamarinStudy", "XamarinStudy\XamarinStudy\XamarinStudy.csproj", "{63A3840F-773A-4300-B1B8-739E0215DB7B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|Any CPU.ActiveCfg = Debug|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|Any CPU.Build.0 = Debug|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|Any CPU.Deploy.0 = Debug|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|ARM.ActiveCfg = Debug|ARM
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|ARM.Build.0 = Debug|ARM
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|ARM.Deploy.0 = Debug|ARM
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|x64.ActiveCfg = Debug|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|x64.Build.0 = Debug|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|x64.Deploy.0 = Debug|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|x86.ActiveCfg = Debug|x86
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|x86.Build.0 = Debug|x86
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Debug|x86.Deploy.0 = Debug|x86
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|Any CPU.ActiveCfg = Release|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|Any CPU.Build.0 = Release|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|Any CPU.Deploy.0 = Release|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|ARM.ActiveCfg = Release|ARM
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|ARM.Build.0 = Release|ARM
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|ARM.Deploy.0 = Release|ARM
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|x64.ActiveCfg = Release|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|x64.Build.0 = Release|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|x64.Deploy.0 = Release|x64
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|x86.ActiveCfg = Release|x86
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|x86.Build.0 = Release|x86
{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}.Release|x86.Deploy.0 = Release|x86
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|Any CPU.Build.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|ARM.ActiveCfg = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|ARM.Build.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|ARM.Deploy.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|x64.ActiveCfg = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|x64.Build.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|x64.Deploy.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|x86.ActiveCfg = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|x86.Build.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Debug|x86.Deploy.0 = Debug|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|Any CPU.ActiveCfg = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|Any CPU.Build.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|Any CPU.Deploy.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|ARM.ActiveCfg = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|ARM.Build.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|ARM.Deploy.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|x64.ActiveCfg = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|x64.Build.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|x64.Deploy.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|x86.ActiveCfg = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|x86.Build.0 = Release|Any CPU
{085DC5E8-F22B-4E22-9762-AF0AF8973776}.Release|x86.Deploy.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|ARM.ActiveCfg = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|ARM.Build.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|ARM.Deploy.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|x64.ActiveCfg = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|x64.Build.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|x64.Deploy.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|x86.ActiveCfg = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|x86.Build.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Debug|x86.Deploy.0 = Debug|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|Any CPU.Build.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|Any CPU.Deploy.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|ARM.ActiveCfg = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|ARM.Build.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|ARM.Deploy.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|x64.ActiveCfg = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|x64.Build.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|x64.Deploy.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|x86.ActiveCfg = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|x86.Build.0 = Release|Any CPU
{63A3840F-773A-4300-B1B8-739E0215DB7B}.Release|x86.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {BD504A16-ABC9-43EF-8864-F52F043BF58E}
EndGlobalSection
EndGlobal

@ -0,0 +1,19 @@
Any raw assets you want to be deployed with your application can be placed in
this directory (and child directories) and given a Build Action of "AndroidAsset".
These files will be deployed with your package and will be accessible using Android's
AssetManager, like this:
public class ReadAsset : Activity
{
protected override void OnCreate (Bundle bundle)
{
base.OnCreate (bundle);
InputStream input = Assets.Open ("my_asset.txt");
}
}
Additionally, some Android functions will automatically load asset files:
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");

@ -0,0 +1,28 @@
using System;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.OS;
namespace XamarinStudy.Droid
{
[Activity(Label = "XamarinStudy", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
}
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
{
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
}
}
}

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.xamarinstudy">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="31" />
<application android:label="XamarinStudy.Android" android:theme="@style/MainTheme"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</manifest>

@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XamarinStudy.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XamarinStudy.Android")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]

@ -0,0 +1,50 @@
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable-hdpi/
icon.png
drawable-ldpi/
icon.png
drawable-mdpi/
icon.png
layout/
main.xml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called
"Resource" that contains the tokens for each one of the resources included. For example,
for the above Resources layout, this is what the Resource class would expose:
public class Resource {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
string in the dictionary file values/strings.xml.

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/launcher_background" />
<foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/launcher_background" />
<foreground android:drawable="@mipmap/launcher_foreground" />
</adaptive-icon>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="launcher_background">#FFFFFF</color>
<color name="colorPrimary">#3F51B5</color>
<color name="colorPrimaryDark">#303F9F</color>
<color name="colorAccent">#FF4081</color>
</resources>

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<style name="MainTheme" parent="MainTheme.Base">
<!-- As of Xamarin.Forms 4.6 the theme has moved into the Forms binary -->
<!-- If you want to override anything you can do that here. -->
<!-- Underneath are a couple of entries to get you started. -->
<!-- Set theme colors from https://aka.ms/material-colors -->
<!-- colorPrimary is used for the default action bar background -->
<!--<item name="colorPrimary">#2196F3</item>-->
<!-- colorPrimaryDark is used for the status bar -->
<!--<item name="colorPrimaryDark">#1976D2</item>-->
<!-- colorAccent is used as the default value for colorControlActivated
which is used to tint widgets -->
<!--<item name="colorAccent">#FF4081</item>-->
</style>
</resources>

@ -0,0 +1,96 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{085DC5E8-F22B-4E22-9762-AF0AF8973776}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{6968b3a4-1835-46a3-ac5c-1ae33b475983}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>XamarinStudy.Droid</RootNamespace>
<AssemblyName>XamarinStudy.Android</AssemblyName>
<Deterministic>True</Deterministic>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v12.0</TargetFrameworkVersion>
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
<AndroidUseAapt2>true</AndroidUseAapt2>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Numerics" />
<Reference Include="System.Numerics.Vectors" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\drawable\xamarin_logo.png" />
<AndroidResource Include="Resources\drawable\icon_about.png" />
<AndroidResource Include="Resources\drawable\icon_feed.png" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XamarinStudy\XamarinStudy.csproj">
<Project>{FEEC7961-A6A9-47D9-A82D-6B1F0ABFB3D9}</Project>
<Name>XamarinStudy</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>

@ -0,0 +1,7 @@
<Application
x:Class="XamarinStudy.UWP.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamarinStudy.UWP">
</Application>

@ -0,0 +1,106 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.ApplicationModel;
using Windows.ApplicationModel.Activation;
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;
namespace XamarinStudy.UWP
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
sealed partial class App : Application
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
this.Suspending += OnSuspending;
}
/// <summary>
/// Invoked when the application is launched normally by the end user. Other entry points
/// will be used such as when the application is launched to open a specific file.
/// </summary>
/// <param name="e">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs e)
{
#if DEBUG
if (System.Diagnostics.Debugger.IsAttached)
{
this.DebugSettings.EnableFrameRateCounter = true;
}
#endif
Frame rootFrame = Window.Current.Content as Frame;
// Do not repeat app initialization when the Window already has content,
// just ensure that the window is active
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
global::Xamarin.Forms.Forms.SetFlags("Shell_UWP_Experimental");
Xamarin.Forms.Forms.Init(e);
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
// Ensure the current window is active
Window.Current.Activate();
}
/// <summary>
/// Invoked when Navigation to a certain page fails
/// </summary>
/// <param name="sender">The Frame which failed navigation</param>
/// <param name="e">Details about the navigation failure</param>
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
{
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
}
/// <summary>
/// Invoked when application execution is being suspended. Application state is saved
/// without knowing whether the application will be terminated or resumed with the contents
/// of memory still intact.
/// </summary>
/// <param name="sender">The source of the suspend request.</param>
/// <param name="e">Details about the suspend request.</param>
private void OnSuspending(object sender, SuspendingEventArgs e)
{
var deferral = e.SuspendingOperation.GetDeferral();
//TODO: Save application state and stop any background activity
deferral.Complete();
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 394 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 392 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

@ -0,0 +1,12 @@
<forms:WindowsPage
x:Class="XamarinStudy.UWP.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:forms="using:Xamarin.Forms.Platform.UWP"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:XamarinStudy.UWP"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
</Grid>
</forms:WindowsPage>

@ -0,0 +1,27 @@
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;
namespace XamarinStudy.UWP
{
public sealed partial class MainPage
{
public MainPage()
{
this.InitializeComponent();
LoadApplication(new XamarinStudy.App());
}
}
}

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
IgnorableNamespaces="uap mp">
<Identity
Name="A7DA88BE-98B5-403F-B23A-6D3A019321B2"
Publisher="CN=7AE0E5F7-40FB-4C62-82F6-F3A2030FEFEA"
Version="1.0.0.0" />
<mp:PhoneIdentity PhoneProductId="ec0cc741-fd3e-485c-81be-68815c480690" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
<Properties>
<DisplayName>XamarinStudy.UWP</DisplayName>
<PublisherDisplayName>7AE0E5F7-40FB-4C62-82F6-F3A2030FEFEA</PublisherDisplayName>
<Logo>Assets\StoreLogo.png</Logo>
</Properties>
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
<Resources>
<Resource Language="x-generate"/>
</Resources>
<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="XamarinStudy.UWP.App">
<uap:VisualElements
DisplayName="XamarinStudy.UWP"
Square150x150Logo="Assets\Square150x150Logo.png"
Square44x44Logo="Assets\Square44x44Logo.png"
Description="XamarinStudy.UWP"
BackgroundColor="transparent">
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png" Square310x310Logo="Assets\LargeTile.png" Square71x71Logo="Assets\SmallTile.png">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo" />
<uap:ShowOn Tile="wide310x150Logo" />
<uap:ShowOn Tile="square310x310Logo" />
</uap:ShowNameOnTiles>
</uap:DefaultTile>
<uap:SplashScreen Image="Assets\SplashScreen.png" />
</uap:VisualElements>
</Application>
</Applications>
<Capabilities>
<Capability Name="internetClient" />
</Capabilities>
</Package>

@ -0,0 +1,29 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("XamarinStudy.UWP")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("XamarinStudy.UWP")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: ComVisible(false)]

@ -0,0 +1,31 @@
<!--
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
developers. However, you can modify these parameters to modify the behavior of the .NET Native
optimizer.
Runtime Directives are documented at https://go.microsoft.com/fwlink/?LinkID=391919
To fully enable reflection for App1.MyClass and all of its public/private members
<Type Name="App1.MyClass" Dynamic="Required All"/>
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
-->
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
<Application>
<!--
An Assembly element with Name="*Application*" applies to all assemblies in
the application package. The asterisks are not wildcards.
-->
<Assembly Name="*Application*" Dynamic="Required All" />
<!-- Add your application specific runtime directives here. -->
</Application>
</Directives>

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProjectGuid>{8F6B1A53-1BC3-4F00-9189-3585257CF2D2}</ProjectGuid>
<TemplateGuid>{98C37F10-6541-44BE-B1E6-7EB3EB8C08F1}</TemplateGuid>
<OutputType>AppContainerExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>XamarinStudy.UWP</RootNamespace>
<AssemblyName>XamarinStudy.UWP</AssemblyName>
<DefaultLanguage>en-US</DefaultLanguage>
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
<TargetPlatformVersion>10.0.19041.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.16299.0</TargetPlatformMinVersion>
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
<EnableDotNetNativeCompatibleProfile>true</EnableDotNetNativeCompatibleProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<AppxPackageSigningEnabled>false</AppxPackageSigningEnabled>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\ARM\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>portable</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
<OutputPath>bin\ARM\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>ARM</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x64\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>portable</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<OutputPath>bin\x64\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x64</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\x86\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<NoWarn>;2008</NoWarn>
<DebugType>portable</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
<Optimize>true</Optimize>
<NoWarn>;2008</NoWarn>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
<UseVSHostingProcess>false</UseVSHostingProcess>
<ErrorReport>prompt</ErrorReport>
<Prefer32Bit>true</Prefer32Bit>
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
</PropertyGroup>
<ItemGroup>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
</Compile>
<Compile Include="MainPage.xaml.cs">
<DependentUpon>MainPage.xaml</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<AppxManifest Include="Package.appxmanifest">
<SubType>Designer</SubType>
</AppxManifest>
</ItemGroup>
<ItemGroup>
<Content Include="Properties\Default.rd.xml" />
<Content Include="Assets\LargeTile.scale-100.png" />
<Content Include="Assets\LargeTile.scale-200.png" />
<Content Include="Assets\LargeTile.scale-400.png" />
<Content Include="Assets\SmallTile.scale-100.png" />
<Content Include="Assets\SmallTile.scale-200.png" />
<Content Include="Assets\SmallTile.scale-400.png" />
<Content Include="Assets\SplashScreen.scale-100.png" />
<Content Include="Assets\SplashScreen.scale-200.png" />
<Content Include="Assets\SplashScreen.scale-400.png" />
<Content Include="Assets\Square150x150Logo.scale-100.png" />
<Content Include="Assets\Square150x150Logo.scale-200.png" />
<Content Include="Assets\Square150x150Logo.scale-400.png" />
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-16.png" />
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-256.png" />
<Content Include="Assets\Square44x44Logo.altform-unplated_targetsize-48.png" />
<Content Include="Assets\Square44x44Logo.scale-100.png" />
<Content Include="Assets\Square44x44Logo.scale-200.png" />
<Content Include="Assets\Square44x44Logo.scale-400.png" />
<Content Include="Assets\Square44x44Logo.targetsize-16.png" />
<Content Include="Assets\Square44x44Logo.targetsize-256.png" />
<Content Include="Assets\Square44x44Logo.targetsize-48.png" />
<Content Include="Assets\StoreLogo.scale-100.png" />
<Content Include="Assets\StoreLogo.scale-200.png" />
<Content Include="Assets\StoreLogo.scale-400.png" />
<Content Include="Assets\Wide310x150Logo.scale-100.png" />
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
<Content Include="Assets\Wide310x150Logo.scale-400.png" />
<Content Include="xamarin_logo.png" />
<Content Include="icon_about.png" />
<Content Include="icon_feed.png" />
</ItemGroup>
<ItemGroup>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Page Include="MainPage.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
<PackageReference Include="Microsoft.NETCore.UniversalWindowsPlatform" Version="6.2.12"/>
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\XamarinStudy\XamarinStudy.csproj">
<Project>{FEEC7961-A6A9-47D9-A82D-6B1F0ABFB3D9}</Project>
<Name>XamarinStudy</Name>
</ProjectReference>
</ItemGroup>
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' &lt; '14.0' ">
<VisualStudioVersion>14.0</VisualStudioVersion>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
</Project>

Binary file not shown.

After

Width:  |  Height:  |  Size: 518 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 415 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

@ -0,0 +1,32 @@
<?xml version="1.0" encoding="utf-8" ?>
<Application xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinStudy.App">
<!--
Define global resources and styles here, that apply to all pages in your app.
-->
<Application.Resources>
<ResourceDictionary>
<Color x:Key="Primary">#2196F3</Color>
<Style TargetType="Button">
<Setter Property="TextColor" Value="White"></Setter>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#332196F3" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>

@ -0,0 +1,32 @@
using System;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamarinStudy.Services;
using XamarinStudy.Views;
namespace XamarinStudy
{
public partial class App : Application
{
public App()
{
InitializeComponent();
DependencyService.Register<MockDataStore>();
MainPage = new AppShell();
}
protected override void OnStart()
{
}
protected override void OnSleep()
{
}
protected override void OnResume()
{
}
}
}

@ -0,0 +1,136 @@
<?xml version="1.0" encoding="UTF-8"?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:XamarinStudy.Views"
Title="XamarinStudy"
x:Class="XamarinStudy.AppShell">
<!--
The overall app visual hierarchy is defined here, along with navigation.
https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/
-->
<Shell.Resources>
<ResourceDictionary>
<Style x:Key="BaseStyle" TargetType="Element">
<Setter Property="Shell.BackgroundColor" Value="{StaticResource Primary}" />
<Setter Property="Shell.ForegroundColor" Value="White" />
<Setter Property="Shell.TitleColor" Value="White" />
<Setter Property="Shell.DisabledColor" Value="#B4FFFFFF" />
<Setter Property="Shell.UnselectedColor" Value="#95FFFFFF" />
<Setter Property="Shell.TabBarBackgroundColor" Value="{StaticResource Primary}" />
<Setter Property="Shell.TabBarForegroundColor" Value="White"/>
<Setter Property="Shell.TabBarUnselectedColor" Value="#95FFFFFF"/>
<Setter Property="Shell.TabBarTitleColor" Value="White"/>
</Style>
<Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" />
<Style TargetType="FlyoutItem" BasedOn="{StaticResource BaseStyle}" />
<!--
Default Styles for all Flyout Items
https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#flyoutitem-and-menuitem-style-classes
-->
<Style Class="FlyoutItemLabelStyle" TargetType="Label">
<Setter Property="TextColor" Value="White"></Setter>
</Style>
<Style Class="FlyoutItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{x:OnPlatform UWP=Transparent, iOS=White}" />
<Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" />
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="{StaticResource Primary}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<!--
Custom Style you can apply to any Flyout Item
-->
<Style Class="MenuItemLayoutStyle" TargetType="Layout" ApplyToDerivedTypes="True">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter TargetName="FlyoutItemLabel" Property="Label.TextColor" Value="{StaticResource Primary}" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</ResourceDictionary>
</Shell.Resources>
<!--
When the Flyout is visible this defines the content to display in the flyout.
FlyoutDisplayOptions="AsMultipleItems" will create a separate flyout item for each child element
https://docs.microsoft.com/dotnet/api/xamarin.forms.shellgroupitem.flyoutdisplayoptions?view=xamarin-forms
-->
<FlyoutItem Title="About" Icon="icon_about.png">
<ShellContent Route="AboutPage" ContentTemplate="{DataTemplate local:AboutPage}" />
</FlyoutItem>
<FlyoutItem Title="Browse" Icon="icon_feed.png">
<ShellContent Route="ItemsPage" ContentTemplate="{DataTemplate local:ItemsPage}" />
</FlyoutItem>
<!-- When the Flyout is visible this will be a menu item you can tie a click behavior to -->
<MenuItem Text="Logout" StyleClass="MenuItemLayoutStyle" Clicked="OnMenuItemClicked">
</MenuItem>
<!--
TabBar lets you define content that won't show up in a flyout menu. When this content is active
the flyout menu won't be available. This is useful for creating areas of the application where
you don't want users to be able to navigate away from. If you would like to navigate to this
content you can do so by calling
await Shell.Current.GoToAsync("//LoginPage");
-->
<TabBar>
<ShellContent Route="LoginPage" ContentTemplate="{DataTemplate local:LoginPage}" />
</TabBar>
<!-- Optional Templates
// These may be provided inline as below or as separate classes.
// This header appears at the top of the Flyout.
// https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#flyout-header
<Shell.FlyoutHeaderTemplate>
<DataTemplate>
<Grid>ContentHere</Grid>
</DataTemplate>
</Shell.FlyoutHeaderTemplate>
// ItemTemplate is for ShellItems as displayed in a Flyout
// https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#define-flyoutitem-appearance
<Shell.ItemTemplate>
<DataTemplate>
<ContentView>
Bindable Properties: Title, Icon
</ContentView>
</DataTemplate>
</Shell.ItemTemplate>
// MenuItemTemplate is for MenuItems as displayed in a Flyout
// https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/shell/flyout#define-menuitem-appearance
<Shell.MenuItemTemplate>
<DataTemplate>
<ContentView>
Bindable Properties: Text, Icon
</ContentView>
</DataTemplate>
</Shell.MenuItemTemplate>
-->
</Shell>

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using Xamarin.Forms;
using XamarinStudy.ViewModels;
using XamarinStudy.Views;
namespace XamarinStudy
{
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");
}
}
}

@ -0,0 +1,3 @@
using Xamarin.Forms.Xaml;
[assembly: XamlCompilation(XamlCompilationOptions.Compile)]

@ -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 <MainProject>\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

@ -0,0 +1,11 @@
using System;
namespace XamarinStudy.Models
{
public class Item
{
public string Id { get; set; }
public string Text { get; set; }
public string Description { get; set; }
}
}

@ -0,0 +1,15 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace XamarinStudy.Services
{
public interface IDataStore<T>
{
Task<bool> AddItemAsync(T item);
Task<bool> UpdateItemAsync(T item);
Task<bool> DeleteItemAsync(string id);
Task<T> GetItemAsync(string id);
Task<IEnumerable<T>> GetItemsAsync(bool forceRefresh = false);
}
}

@ -0,0 +1,60 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using XamarinStudy.Models;
namespace XamarinStudy.Services
{
public class MockDataStore : IDataStore<Item>
{
readonly List<Item> items;
public MockDataStore()
{
items = new List<Item>()
{
new Item { Id = Guid.NewGuid().ToString(), Text = "First item", Description="This is an item description." },
new Item { Id = Guid.NewGuid().ToString(), Text = "Second item", Description="This is an item description." },
new Item { Id = Guid.NewGuid().ToString(), Text = "Third item", Description="This is an item description." },
new Item { Id = Guid.NewGuid().ToString(), Text = "Fourth item", Description="This is an item description." },
new Item { Id = Guid.NewGuid().ToString(), Text = "Fifth item", Description="This is an item description." },
new Item { Id = Guid.NewGuid().ToString(), Text = "Sixth item", Description="This is an item description." }
};
}
public async Task<bool> AddItemAsync(Item item)
{
items.Add(item);
return await Task.FromResult(true);
}
public async Task<bool> UpdateItemAsync(Item item)
{
var oldItem = items.Where((Item arg) => arg.Id == item.Id).FirstOrDefault();
items.Remove(oldItem);
items.Add(item);
return await Task.FromResult(true);
}
public async Task<bool> DeleteItemAsync(string id)
{
var oldItem = items.Where((Item arg) => arg.Id == id).FirstOrDefault();
items.Remove(oldItem);
return await Task.FromResult(true);
}
public async Task<Item> GetItemAsync(string id)
{
return await Task.FromResult(items.FirstOrDefault(s => s.Id == id));
}
public async Task<IEnumerable<Item>> GetItemsAsync(bool forceRefresh = false)
{
return await Task.FromResult(items);
}
}
}

@ -0,0 +1,18 @@
using System;
using System.Windows.Input;
using Xamarin.Essentials;
using Xamarin.Forms;
namespace XamarinStudy.ViewModels
{
public class AboutViewModel : BaseViewModel
{
public AboutViewModel()
{
Title = "About";
OpenWebCommand = new Command(async () => await Browser.OpenAsync("https://aka.ms/xamarin-quickstart"));
}
public ICommand OpenWebCommand { get; }
}
}

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using Xamarin.Forms;
using XamarinStudy.Models;
using XamarinStudy.Services;
namespace XamarinStudy.ViewModels
{
public class BaseViewModel : INotifyPropertyChanged
{
public IDataStore<Item> DataStore => DependencyService.Get<IDataStore<Item>>();
bool isBusy = false;
public bool IsBusy
{
get { return isBusy; }
set { SetProperty(ref isBusy, value); }
}
string title = string.Empty;
public string Title
{
get { return title; }
set { SetProperty(ref title, value); }
}
protected bool SetProperty<T>(ref T backingStore, T value,
[CallerMemberName] string propertyName = "",
Action onChanged = null)
{
if (EqualityComparer<T>.Default.Equals(backingStore, value))
return false;
backingStore = value;
onChanged?.Invoke();
OnPropertyChanged(propertyName);
return true;
}
#region INotifyPropertyChanged
public event PropertyChangedEventHandler PropertyChanged;
protected void OnPropertyChanged([CallerMemberName] string propertyName = "")
{
var changed = PropertyChanged;
if (changed == null)
return;
changed.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}

@ -0,0 +1,57 @@
using System;
using System.Diagnostics;
using System.Threading.Tasks;
using Xamarin.Forms;
using XamarinStudy.Models;
namespace XamarinStudy.ViewModels
{
[QueryProperty(nameof(ItemId), nameof(ItemId))]
public class ItemDetailViewModel : BaseViewModel
{
private string itemId;
private string text;
private string description;
public string Id { get; set; }
public string Text
{
get => text;
set => SetProperty(ref text, value);
}
public string Description
{
get => description;
set => SetProperty(ref description, value);
}
public string ItemId
{
get
{
return itemId;
}
set
{
itemId = value;
LoadItemId(value);
}
}
public async void LoadItemId(string itemId)
{
try
{
var item = await DataStore.GetItemAsync(itemId);
Id = item.Id;
Text = item.Text;
Description = item.Description;
}
catch (Exception)
{
Debug.WriteLine("Failed to Load Item");
}
}
}
}

@ -0,0 +1,86 @@
using System;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Threading.Tasks;
using Xamarin.Forms;
using XamarinStudy.Models;
using XamarinStudy.Views;
namespace XamarinStudy.ViewModels
{
public class ItemsViewModel : BaseViewModel
{
private Item _selectedItem;
public ObservableCollection<Item> Items { get; }
public Command LoadItemsCommand { get; }
public Command AddItemCommand { get; }
public Command<Item> ItemTapped { get; }
public ItemsViewModel()
{
Title = "Browse";
Items = new ObservableCollection<Item>();
LoadItemsCommand = new Command(async () => await ExecuteLoadItemsCommand());
ItemTapped = new Command<Item>(OnItemSelected);
AddItemCommand = new Command(OnAddItem);
}
async Task ExecuteLoadItemsCommand()
{
IsBusy = true;
try
{
Items.Clear();
var items = await DataStore.GetItemsAsync(true);
foreach (var item in items)
{
Items.Add(item);
}
}
catch (Exception ex)
{
Debug.WriteLine(ex);
}
finally
{
IsBusy = false;
}
}
public void OnAppearing()
{
IsBusy = true;
SelectedItem = null;
}
public Item SelectedItem
{
get => _selectedItem;
set
{
SetProperty(ref _selectedItem, value);
OnItemSelected(value);
}
}
private async void OnAddItem(object obj)
{
await Shell.Current.GoToAsync(nameof(NewItemPage));
}
async void OnItemSelected(Item item)
{
if (item == null)
return;
// This will push the ItemDetailPage onto the navigation stack
await Shell.Current.GoToAsync($"{nameof(ItemDetailPage)}?{nameof(ItemDetailViewModel.ItemId)}={item.Id}");
}
}
}

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Text;
using Xamarin.Forms;
using XamarinStudy.Views;
namespace XamarinStudy.ViewModels
{
public class LoginViewModel : BaseViewModel
{
public Command LoginCommand { get; }
public LoginViewModel()
{
LoginCommand = new Command(OnLoginClicked);
}
private async void OnLoginClicked(object obj)
{
// Prefixing with `//` switches to a different navigation stack instead of pushing to the active one
await Shell.Current.GoToAsync($"//{nameof(AboutPage)}");
}
}
}

@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Input;
using Xamarin.Forms;
using XamarinStudy.Models;
namespace XamarinStudy.ViewModels
{
public class NewItemViewModel : BaseViewModel
{
private string text;
private string description;
public NewItemViewModel()
{
SaveCommand = new Command(OnSave, ValidateSave);
CancelCommand = new Command(OnCancel);
this.PropertyChanged +=
(_, __) => SaveCommand.ChangeCanExecute();
}
private bool ValidateSave()
{
return !String.IsNullOrWhiteSpace(text)
&& !String.IsNullOrWhiteSpace(description);
}
public string Text
{
get => text;
set => SetProperty(ref text, value);
}
public string Description
{
get => description;
set => SetProperty(ref description, value);
}
public Command SaveCommand { get; }
public Command CancelCommand { get; }
private async void OnCancel()
{
// This will pop the current page off the navigation stack
await Shell.Current.GoToAsync("..");
}
private async void OnSave()
{
Item newItem = new Item()
{
Id = Guid.NewGuid().ToString(),
Text = Text,
Description = Description
};
await DataStore.AddItemAsync(newItem);
// This will pop the current page off the navigation stack
await Shell.Current.GoToAsync("..");
}
}
}

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinStudy.Views.AboutPage"
xmlns:vm="clr-namespace:XamarinStudy.ViewModels"
Title="{Binding Title}">
<ContentPage.BindingContext>
<vm:AboutViewModel />
</ContentPage.BindingContext>
<ContentPage.Resources>
<ResourceDictionary>
<Color x:Key="Accent">#96d1ff</Color>
</ResourceDictionary>
</ContentPage.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<StackLayout BackgroundColor="{StaticResource Accent}" VerticalOptions="FillAndExpand" HorizontalOptions="Fill">
<StackLayout Orientation="Horizontal" HorizontalOptions="Center" VerticalOptions="Center">
<ContentView Padding="0,40,0,40" VerticalOptions="FillAndExpand">
<Image Source="xamarin_logo.png" VerticalOptions="Center" HeightRequest="64" />
</ContentView>
</StackLayout>
</StackLayout>
<ScrollView Grid.Row="1">
<StackLayout Orientation="Vertical" Padding="30,24,30,24" Spacing="10">
<Label Text="Start developing now" FontSize="Title"/>
<Label Text="Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!" FontSize="16" Padding="0,0,0,0"/>
<Label FontSize="16" Padding="0,24,0,0">
<Label.FormattedText>
<FormattedString>
<FormattedString.Spans>
<Span Text="Learn more at "/>
<Span Text="https://aka.ms/xamarin-quickstart" FontAttributes="Bold"/>
</FormattedString.Spans>
</FormattedString>
</Label.FormattedText>
</Label>
<Button Margin="0,10,0,0" Text="Learn more"
Command="{Binding OpenWebCommand}"
BackgroundColor="{StaticResource Primary}"
TextColor="White" />
</StackLayout>
</ScrollView>
</Grid>
</ContentPage>

@ -0,0 +1,15 @@
using System;
using System.ComponentModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace XamarinStudy.Views
{
public partial class AboutPage : ContentPage
{
public AboutPage()
{
InitializeComponent();
}
}
}

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinStudy.Views.ItemDetailPage"
Title="{Binding Title}">
<StackLayout Spacing="20" Padding="15">
<Label Text="Text:" FontSize="Medium" />
<Label Text="{Binding Text}" FontSize="Small"/>
<Label Text="Description:" FontSize="Medium" />
<Label Text="{Binding Description}" FontSize="Small"/>
</StackLayout>
</ContentPage>

@ -0,0 +1,15 @@
using System.ComponentModel;
using Xamarin.Forms;
using XamarinStudy.ViewModels;
namespace XamarinStudy.Views
{
public partial class ItemDetailPage : ContentPage
{
public ItemDetailPage()
{
InitializeComponent();
BindingContext = new ItemDetailViewModel();
}
}
}

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinStudy.Views.ItemsPage"
Title="{Binding Title}"
xmlns:local="clr-namespace:XamarinStudy.ViewModels"
xmlns:model="clr-namespace:XamarinStudy.Models"
x:Name="BrowseItemsPage">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Add" Command="{Binding AddItemCommand}" />
</ContentPage.ToolbarItems>
<!--
x:DataType enables compiled bindings for better performance and compile time validation of binding expressions.
https://docs.microsoft.com/xamarin/xamarin-forms/app-fundamentals/data-binding/compiled-bindings
-->
<RefreshView x:DataType="local:ItemsViewModel" Command="{Binding LoadItemsCommand}" IsRefreshing="{Binding IsBusy, Mode=TwoWay}">
<CollectionView x:Name="ItemsListView"
ItemsSource="{Binding Items}"
SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate>
<StackLayout Padding="10" x:DataType="model:Item">
<Label Text="{Binding Text}"
LineBreakMode="NoWrap"
Style="{DynamicResource ListItemTextStyle}"
FontSize="16" />
<Label Text="{Binding Description}"
LineBreakMode="NoWrap"
Style="{DynamicResource ListItemDetailTextStyle}"
FontSize="13" />
<StackLayout.GestureRecognizers>
<TapGestureRecognizer
NumberOfTapsRequired="1"
Command="{Binding Source={RelativeSource AncestorType={x:Type local:ItemsViewModel}}, Path=ItemTapped}"
CommandParameter="{Binding .}">
</TapGestureRecognizer>
</StackLayout.GestureRecognizers>
</StackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</RefreshView>
</ContentPage>

@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamarinStudy.Models;
using XamarinStudy.ViewModels;
using XamarinStudy.Views;
namespace XamarinStudy.Views
{
public partial class ItemsPage : ContentPage
{
ItemsViewModel _viewModel;
public ItemsPage()
{
InitializeComponent();
BindingContext = _viewModel = new ItemsViewModel();
}
protected override void OnAppearing()
{
base.OnAppearing();
_viewModel.OnAppearing();
}
}
}

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:d="http://xamarin.com/schemas/2014/forms/design"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Class="XamarinStudy.Views.LoginPage"
Shell.NavBarIsVisible="False">
<ContentPage.Content>
<StackLayout Padding="10,0,10,0" VerticalOptions="Center">
<Button VerticalOptions="Center" Text="Login" Command="{Binding LoginCommand}"/>
</StackLayout>
</ContentPage.Content>
</ContentPage>

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamarinStudy.ViewModels;
namespace XamarinStudy.Views
{
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class LoginPage : ContentPage
{
public LoginPage()
{
InitializeComponent();
this.BindingContext = new LoginViewModel();
}
}
}

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="XamarinStudy.Views.NewItemPage"
Shell.PresentationMode="ModalAnimated"
Title="New Item"
xmlns:ios="clr-namespace:Xamarin.Forms.PlatformConfiguration.iOSSpecific;assembly=Xamarin.Forms.Core"
ios:Page.UseSafeArea="true">
<ContentPage.Content>
<StackLayout Spacing="3" Padding="15">
<Label Text="Text" FontSize="Medium" />
<Entry Text="{Binding Text, Mode=TwoWay}" FontSize="Medium" />
<Label Text="Description" FontSize="Medium" />
<Editor Text="{Binding Description, Mode=TwoWay}" AutoSize="TextChanges" FontSize="Medium" Margin="0" />
<StackLayout Orientation="Horizontal">
<Button Text="Cancel" Command="{Binding CancelCommand}" HorizontalOptions="FillAndExpand"></Button>
<Button Text="Save" Command="{Binding SaveCommand}" HorizontalOptions="FillAndExpand"></Button>
</StackLayout>
</StackLayout>
</ContentPage.Content>
</ContentPage>

@ -0,0 +1,22 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
using XamarinStudy.Models;
using XamarinStudy.ViewModels;
namespace XamarinStudy.Views
{
public partial class NewItemPage : ContentPage
{
public Item Item { get; set; }
public NewItemPage()
{
InitializeComponent();
BindingContext = new NewItemViewModel();
}
}
}

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<ProduceReferenceAssembly>true</ProduceReferenceAssembly>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="5.0.0.2196" />
<PackageReference Include="Xamarin.Essentials" Version="1.7.0" />
</ItemGroup>
</Project>
Loading…
Cancel
Save