From 8edf5d44b9ee5a37e1a68e83a662c46d5e912d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Ho=C3=A0ng=20Phi=20Long?= Date: Tue, 4 Apr 2023 17:45:21 +0700 Subject: [PATCH 1/2] feature/adaptiveproperties --- .../AdaptivePropertiesControlInfo.cs | 15 ++ .../AdaptivePropertiesPage.xaml | 138 ++++++++++++++++++ .../AdaptivePropertiesPage.xaml.cs | 14 ++ .../AdaptivePropertiesPageViewModel.cs | 68 +++++++++ 4 files changed, 235 insertions(+) create mode 100644 src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesControlInfo.cs create mode 100644 src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml create mode 100644 src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml.cs create mode 100644 src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPageViewModel.cs diff --git a/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesControlInfo.cs b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesControlInfo.cs new file mode 100644 index 00000000..56c14b21 --- /dev/null +++ b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesControlInfo.cs @@ -0,0 +1,15 @@ +namespace MAUIsland.Gallery.Community; +class AdaptivePropertiesControlInfo : IControlInfo +{ + public string ControlName => "AdaptiveProperties"; + public string ControlRoute => typeof(AdaptivePropertiesPage).FullName; + public ImageSource ControlIcon => new FontImageSource() + { + FontFamily = FontNames.FluentSystemIconsRegular, + Glyph = FluentUIIcon.Ic_fluent_approvals_app_20_regular + }; + public string ControlDetail => "A nuget that help MAUI developer adapt their mobile UI application orientations more efficent for simple case"; + public string GitHubUrl => $"https://github.com/Strypper/mauisland/tree/main/src/Features/Gallery/Pages/Community/{ControlName}"; + public string DocumentUrl => $"https://github.com/rudyspano/MAUI-Adaptive-Properties"; + public string GroupName => ControlGroupInfo.GitHubCommunity; +} \ No newline at end of file diff --git a/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml new file mode 100644 index 00000000..0f94d99a --- /dev/null +++ b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml @@ -0,0 +1,138 @@ + + + + + + + + + + + + AdaptiveProperties defines the following properties: + + + + These properties are backed by BindableProperty objects, which means that they can be targets of data bindings, and styled. + + + + + Color, of type Color , value that defines the color of the ActivityIndicator. + ]]> + + + IsRunning, of type bool,value that indicates whether the ActivityIndicator should be visible and animating, or hidden. The default value of this property is false, which indicates that the ActivityIndicator isn't visible. + ]]> + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml.cs b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml.cs new file mode 100644 index 00000000..26db34b3 --- /dev/null +++ b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPage.xaml.cs @@ -0,0 +1,14 @@ +namespace MAUIsland; +public partial class AdaptivePropertiesPage : IControlPage +{ + #region [CTor] + public AdaptivePropertiesPage(AdaptivePropertiesPageViewModel vm) + { + InitializeComponent(); + + BindingContext = vm; + } + #endregion + + +} \ No newline at end of file diff --git a/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPageViewModel.cs b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPageViewModel.cs new file mode 100644 index 00000000..52f0644a --- /dev/null +++ b/src/Features/Gallery/Pages/Community/AdaptiveProperties/AdaptivePropertiesPageViewModel.cs @@ -0,0 +1,68 @@ +namespace MAUIsland; +public partial class AdaptivePropertiesPageViewModel : NavigationAwareBaseViewModel +{ + #region [Fields] + public List ShelfList { get; set; } = new(); + #endregion + + #region [CTor] + public AdaptivePropertiesPageViewModel( + IAppNavigator appNavigator + ) : base(appNavigator) + { + List productList = new(); + productList.Add(new Product { Name = "Product1", Description = "none", ImageUrl = "none", Price = "NotMuch" }); + productList.Add(new Product { Name = "Product2", Description = "none", ImageUrl = "none", Price = "NotMuch" }); + productList.Add(new Product { Name = "Product3", Description = "none", ImageUrl = "none", Price = "NotMuch" }); + productList.Add(new Product { Name = "Product4", Description = "none", ImageUrl = "none", Price = "NotMuch" }); + productList.Add(new Product { Name = "Product5", Description = "none", ImageUrl = "none", Price = "NotMuch" }); + + ShelfList.Add(new Shelf(1) { Name = "cover1", ImageUrl = "none", ProductList = productList }); + ShelfList.Add(new Shelf(2) { Name = "cover2", ImageUrl = "none", ProductList = productList }); + ShelfList.Add(new Shelf(3) { Name = "cover3", ImageUrl = "none", ProductList = productList }); + ShelfList.Add(new Shelf(4) { Name = "cover4", ImageUrl = "none", ProductList = productList }); + + } + #endregion + + #region [Properties] + [ObservableProperty] + IControlInfo controlInformation; + #endregion + + #region [Overrides] + protected override void OnInit(IDictionary query) + { + base.OnInit(query); + + ControlInformation = query.GetData(); + + } + #endregion + + #region [Model] + public class Shelf + { + public int Id { get; set; } + public string Name { get; set; } + public string ImageUrl { get; set; } + public List ProductList { get; internal set; } = new List(); + + public Shelf(int id) + { + Id = id; + } + } + + public class Product + { + public string Name { get; set; } + + public string Description { get; set; } + + public string ImageUrl { get; set; } + + public string Price { get; set; } + } + #endregion +} \ No newline at end of file From 32544cb8d98d4de74bd4877834f6545c640d05c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=E1=BB=93=20=C4=90=E1=BA=AFc=20To=C3=A0n?= Date: Tue, 18 Apr 2023 00:51:35 +0700 Subject: [PATCH 2/2] Update README --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f4ff5cd..2802edc2 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ To install .NET MAUI Control Gallery on your device or emulator/simulator: 1. Clone or download this repository 2. Open the solution file (.sln) in Visual Studio 2022 or later 3. Select your target platform and device/emulator/simulator -4. Build and run the app +4. Create the appsettings.Development.json file and this file will not contain any private key +5. Build and run the app We will publish our application on all platforms soon enough. Stay tuned!!!