diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml
index b264f7b..f42905a 100644
--- a/.github/workflows/pr.yml
+++ b/.github/workflows/pr.yml
@@ -17,4 +17,33 @@ jobs:
with:
name: MauiMicroMvvm
solution-path: build.slnf
- install-workload: maui
\ No newline at end of file
+ install-workload: maui
+
+ validate:
+ needs: [build]
+ runs-on: macos-14
+ steps:
+ - name: Setup Xcode
+ uses: maxim-lobanov/setup-xcode@v1
+ with:
+ xcode-version: '15.2'
+ - uses: actions/setup-dotnet@v4
+ with:
+ dotnet-version: 8.0.x
+ - name: Download Artifacts
+ uses: actions/download-artifact@v3
+ with:
+ name: NuGet
+ path: Artifacts
+ - name: Install Templates
+ run: dotnet new install Artifacts/AvantiPoint.MauiMicroMvvm.Templates.*.nupkg
+ - name: Add Local Source
+ run: dotnet nuget add source ${{ github.workspace }}/Artifacts --name Artifacts
+ - name: Create Test Project
+ run: dotnet new maui-micro -o TestProject
+ - name: Workload Install
+ run: dotnet workload install maui
+ working-directory: TestProject
+ - name: Build Project
+ run: dotnet build
+ working-directory: TestProject
\ No newline at end of file
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
new file mode 100644
index 0000000..b3879c2
--- /dev/null
+++ b/.vscode/extensions.json
@@ -0,0 +1,5 @@
+{
+ "recommendations": [
+ "ms-dotnettools.dotnet-maui"
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..c5c01d7
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,14 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET MAUI",
+ "type": "maui",
+ "request": "launch",
+ "preLaunchTask": "maui: Build"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 0000000..de44f25
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,6 @@
+{
+ "cSpell.words": [
+ "autowire",
+ "Mvvm"
+ ]
+}
\ No newline at end of file
diff --git a/Directory.Build.props b/Directory.Build.props
index cdd896b..572dfe7 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -14,6 +14,8 @@
https://github.com/AvantiPoint/mauimicromvvm.git
https://github.com/AvantiPoint/mauimicromvvm
en
+ enable
+ true
@@ -36,15 +38,4 @@
PackagePath="" />
-
-
-
- all
- runtime; build; native; contentfiles; analyzers
-
-
- all
- runtime; build; native; contentfiles; analyzers
-
-
\ No newline at end of file
diff --git a/Directory.Packages.props b/Directory.Packages.props
new file mode 100644
index 0000000..d882a2d
--- /dev/null
+++ b/Directory.Packages.props
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/MauiMicroSample/AppShell.xaml b/sample/MauiMicroSample/AppShell.xaml
index 35f9231..c76c71e 100644
--- a/sample/MauiMicroSample/AppShell.xaml
+++ b/sample/MauiMicroSample/AppShell.xaml
@@ -16,6 +16,11 @@
+
+
+
+
diff --git a/sample/MauiMicroSample/MauiMicroSample.csproj b/sample/MauiMicroSample/MauiMicroSample.csproj
index b91b1cf..242c253 100644
--- a/sample/MauiMicroSample/MauiMicroSample.csproj
+++ b/sample/MauiMicroSample/MauiMicroSample.csproj
@@ -1,4 +1,4 @@
-
+
$(DotNetVersion)-android;$(DotNetVersion)-ios;$(DotNetVersion)-maccatalyst
@@ -16,7 +16,6 @@
com.avantipoint.mauimicro
- CE320681-9974-4D30-B5AB-3FC8834733FD
1.0
@@ -49,8 +48,9 @@
-
-
+
+
+
diff --git a/sample/MauiMicroSample/MauiProgram.cs b/sample/MauiMicroSample/MauiProgram.cs
index 41297cb..c3672ea 100644
--- a/sample/MauiMicroSample/MauiProgram.cs
+++ b/sample/MauiMicroSample/MauiProgram.cs
@@ -23,6 +23,7 @@ public static MauiApp CreateMauiApp()
});
builder.Services.MapView()
+ .MapView()
.MapView()
.MapView()
.MapView()
diff --git a/sample/MauiMicroSample/Pages/DialogDemo.xaml b/sample/MauiMicroSample/Pages/DialogDemo.xaml
new file mode 100644
index 0000000..cbfb325
--- /dev/null
+++ b/sample/MauiMicroSample/Pages/DialogDemo.xaml
@@ -0,0 +1,16 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/sample/MauiMicroSample/Pages/DialogDemo.xaml.cs b/sample/MauiMicroSample/Pages/DialogDemo.xaml.cs
new file mode 100644
index 0000000..890b187
--- /dev/null
+++ b/sample/MauiMicroSample/Pages/DialogDemo.xaml.cs
@@ -0,0 +1,9 @@
+namespace MauiMicroSample.Pages;
+
+public partial class DialogDemo : ContentPage
+{
+ public DialogDemo()
+ {
+ InitializeComponent();
+ }
+}
\ No newline at end of file
diff --git a/sample/MauiMicroSample/Pages/MainPage.xaml.cs b/sample/MauiMicroSample/Pages/MainPage.xaml.cs
index 6adef1b..e6fbf79 100644
--- a/sample/MauiMicroSample/Pages/MainPage.xaml.cs
+++ b/sample/MauiMicroSample/Pages/MainPage.xaml.cs
@@ -1,10 +1,9 @@
-namespace MauiMicroSample.Pages
+namespace MauiMicroSample.Pages;
+
+public partial class MainPage : ContentPage
{
- public partial class MainPage : ContentPage
+ public MainPage()
{
- public MainPage()
- {
- InitializeComponent();
- }
+ InitializeComponent();
}
}
\ No newline at end of file
diff --git a/sample/MauiMicroSample/Resources/Images/dialog.svg b/sample/MauiMicroSample/Resources/Images/dialog.svg
new file mode 100644
index 0000000..e671a04
--- /dev/null
+++ b/sample/MauiMicroSample/Resources/Images/dialog.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/sample/MauiMicroSample/ViewModels/DialogDemoViewModel.cs b/sample/MauiMicroSample/ViewModels/DialogDemoViewModel.cs
new file mode 100644
index 0000000..e6283a0
--- /dev/null
+++ b/sample/MauiMicroSample/ViewModels/DialogDemoViewModel.cs
@@ -0,0 +1,23 @@
+using System.Windows.Input;
+using MauiMicroMvvm;
+
+namespace MauiMicroSample.ViewModels;
+
+public class DialogDemoViewModel : MauiMicroViewModel
+{
+ public DialogDemoViewModel(ViewModelContext context)
+ : base(context)
+ {
+ ShowActionSheetCommand = new Command(async () => {
+ await context.PageDialogs.DisplayActionSheet("Sample Action Sheet", "Cancel", "Destroy", "Button 1", "Button 2");
+ });
+
+ ShowAlertCommand = new Command(async () => {
+ await context.PageDialogs.DisplayAlert("Sample Alert", "This is a sample alert", "Accept", "Cancel");
+ });
+ }
+
+ public ICommand ShowAlertCommand { get; }
+
+ public ICommand ShowActionSheetCommand { get; }
+}
\ No newline at end of file
diff --git a/src/MauiMicroMvvm.Rx/MauiMicroMvvm.Rx.csproj b/src/MauiMicroMvvm.Rx/MauiMicroMvvm.Rx.csproj
index beb009d..8a6c3ed 100644
--- a/src/MauiMicroMvvm.Rx/MauiMicroMvvm.Rx.csproj
+++ b/src/MauiMicroMvvm.Rx/MauiMicroMvvm.Rx.csproj
@@ -1,4 +1,4 @@
-
+
$(DotNetVersion)
@@ -12,7 +12,7 @@
-
+
diff --git a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.template.config/template.json b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.template.config/template.json
index 61fa362..8fcdc2a 100644
--- a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.template.config/template.json
+++ b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.template.config/template.json
@@ -30,7 +30,7 @@
"datatype": "choice",
"enableQuotelessLiterals": true,
"replaces": "$dotnetversion$",
- "defaultValue": "net7.0",
+ "defaultValue": "net8.0",
"description": "Target Framework",
"choices": [
{
diff --git a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.vscode/extensions.json b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.vscode/extensions.json
new file mode 100644
index 0000000..b3879c2
--- /dev/null
+++ b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.vscode/extensions.json
@@ -0,0 +1,5 @@
+{
+ "recommendations": [
+ "ms-dotnettools.dotnet-maui"
+ ]
+}
\ No newline at end of file
diff --git a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.vscode/launch.json b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.vscode/launch.json
new file mode 100644
index 0000000..c5c01d7
--- /dev/null
+++ b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/.vscode/launch.json
@@ -0,0 +1,14 @@
+{
+ // Use IntelliSense to learn about possible attributes.
+ // Hover to view descriptions of existing attributes.
+ // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": [
+ {
+ "name": ".NET MAUI",
+ "type": "maui",
+ "request": "launch",
+ "preLaunchTask": "maui: Build"
+ }
+ ]
+}
\ No newline at end of file
diff --git a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/MauiMicroApp.1.csproj b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/MauiMicroApp.1.csproj
index 7f56f1a..67e902a 100644
--- a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/MauiMicroApp.1.csproj
+++ b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/MauiMicroApp.1.csproj
@@ -17,7 +17,6 @@
$ApplicationId$
- 683037c3-6415-40f7-a541-bdc57964b0d2
1.0
@@ -52,6 +51,8 @@
+
+
diff --git a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/ViewModels/MainViewModel.cs b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/ViewModels/MainViewModel.cs
index 5745d16..40d21c5 100644
--- a/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/ViewModels/MainViewModel.cs
+++ b/src/MauiMicroMvvm.Templates/content/MauiMicroApp.1/ViewModels/MainViewModel.cs
@@ -41,5 +41,8 @@ private void OnClickCommand()
Message = $"Pressed {_count} times!";
_screenReader.Announce(Message);
+
+ if (_count > 3)
+ PageDialogs.DisplayAlert("Stop it!", "You're pressing too much!", "OK");
}
}
diff --git a/src/MauiMicroMvvm/MauiMicroMvvm.csproj b/src/MauiMicroMvvm/MauiMicroMvvm.csproj
index 76bc292..3cda0f4 100644
--- a/src/MauiMicroMvvm/MauiMicroMvvm.csproj
+++ b/src/MauiMicroMvvm/MauiMicroMvvm.csproj
@@ -16,7 +16,7 @@
-
+
diff --git a/src/MauiMicroMvvm/Xaml/MauiMicro.cs b/src/MauiMicroMvvm/Xaml/MauiMicro.cs
index cabfa24..20e4559 100644
--- a/src/MauiMicroMvvm/Xaml/MauiMicro.cs
+++ b/src/MauiMicroMvvm/Xaml/MauiMicro.cs
@@ -46,10 +46,10 @@ private static void OnRouteChanged(BindableObject bindable, object oldValue, obj
return;
content.Route = route;
- SetContentTempalte(content, route);
+ SetContentTemplate(content, route);
}
- private static void SetContentTempalte(ShellContent content, string route)
+ private static void SetContentTemplate(ShellContent content, string route)
{
content.ContentTemplate = new DataTemplate(() => CreateView(route));
}