diff --git a/samples/MauiEmbedding/Directory.Packages.props b/samples/MauiEmbedding/Directory.Packages.props
index 8a4a39df79..52d4140fb5 100644
--- a/samples/MauiEmbedding/Directory.Packages.props
+++ b/samples/MauiEmbedding/Directory.Packages.props
@@ -1,25 +1,32 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.Mobile/MauiEmbedding.Mobile.csproj b/samples/MauiEmbedding/MauiEmbedding.Mobile/MauiEmbedding.Mobile.csproj
index 00b520193e..1ceb79e5a1 100644
--- a/samples/MauiEmbedding/MauiEmbedding.Mobile/MauiEmbedding.Mobile.csproj
+++ b/samples/MauiEmbedding/MauiEmbedding.Mobile/MauiEmbedding.Mobile.csproj
@@ -22,6 +22,10 @@
True
true
+
+
+
+ false
diff --git a/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/MauiEmbedding.Skia.Gtk.csproj b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/MauiEmbedding.Skia.Gtk.csproj
new file mode 100644
index 0000000000..49eff4367b
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/MauiEmbedding.Skia.Gtk.csproj
@@ -0,0 +1,29 @@
+
+
+
+
+
+ WinExe
+ Exe
+ net7.0
+ app.manifest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Package.appxmanifest b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Package.appxmanifest
new file mode 100644
index 0000000000..d4ac5a40e7
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Package.appxmanifest
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+ MauiEmbedding
+ MauiEmbedding
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Program.cs b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Program.cs
new file mode 100644
index 0000000000..03392a6b0c
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Program.cs
@@ -0,0 +1,21 @@
+using System;
+using GLib;
+using Uno.UI.Runtime.Skia;
+
+namespace MauiEmbedding.Skia.Gtk;
+
+public class Program
+{
+ public static void Main(string[] args)
+ {
+ ExceptionManager.UnhandledException += delegate (UnhandledExceptionArgs expArgs)
+ {
+ Console.WriteLine("GLIB UNHANDLED EXCEPTION" + expArgs.ExceptionObject.ToString());
+ expArgs.ExitApplication = true;
+ };
+
+ var host = new GtkHost(() => new AppHead());
+
+ host.Run();
+ }
+}
diff --git a/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/app.manifest b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/app.manifest
new file mode 100644
index 0000000000..e56ae778d0
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/app.manifest
@@ -0,0 +1,77 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true/PM
+ PerMonitorV2, PerMonitor
+
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/LinkerConfig.xml b/samples/MauiEmbedding/MauiEmbedding.Wasm/LinkerConfig.xml
new file mode 100644
index 0000000000..f5396732e4
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/LinkerConfig.xml
@@ -0,0 +1,11 @@
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/MauiEmbedding.Wasm.csproj b/samples/MauiEmbedding/MauiEmbedding.Wasm/MauiEmbedding.Wasm.csproj
new file mode 100644
index 0000000000..c8a36fe934
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/MauiEmbedding.Wasm.csproj
@@ -0,0 +1,75 @@
+
+
+
+
+
+ Exe
+ net7.0
+ $(NoWarn);NU1504;NU1505;NU1701
+
+ disable
+ manifest.webmanifest
+ Properties
+
+ /
+
+
+ true
+ $(DefineConstants);TRACE;DEBUG
+ portable
+ true
+
+ false
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/Program.cs b/samples/MauiEmbedding/MauiEmbedding.Wasm/Program.cs
new file mode 100644
index 0000000000..5c286eff0e
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/Program.cs
@@ -0,0 +1,13 @@
+namespace MauiEmbedding.Wasm;
+
+public class Program
+{
+ private static App? _app;
+
+ public static int Main(string[] args)
+ {
+ Microsoft.UI.Xaml.Application.Start(_ => _app = new AppHead());
+
+ return 0;
+ }
+}
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/WasmCSS/Fonts.css b/samples/MauiEmbedding/MauiEmbedding.Wasm/WasmCSS/Fonts.css
new file mode 100644
index 0000000000..4fdd60555f
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/WasmCSS/Fonts.css
@@ -0,0 +1,28 @@
+/**
+ When adding fonts here, make sure to add them using a base64 data uri, otherwise
+ fonts loading are delayed, and text may get displayed incorrectly.
+*/
+
+/* https://github.com/unoplatform/uno/issues/3954 */
+@font-face {
+ font-family: 'Segoe UI';
+ src: local('Segoe UI'), local('-apple-system'), local('BlinkMacSystemFont'), local('Inter'), local('Cantarell'), local('Ubuntu'), local('Roboto'), local('Open Sans'), local('Noto Sans'), local('Helvetica Neue'), local('sans-serif');
+}
+
+@font-face {
+ font-family: 'Roboto';
+ src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Light.ttf) format('truetype');
+ font-weight: 300;
+}
+
+@font-face {
+ font-family: 'Roboto';
+ src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Regular.ttf) format('truetype');
+ font-weight: 400;
+}
+
+@font-face {
+ font-family: 'Roboto';
+ src: url(./Uno.Fonts.Roboto/Fonts/Roboto-Medium.ttf) format('truetype');
+ font-weight: 500;
+}
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/WasmScripts/AppManifest.js b/samples/MauiEmbedding/MauiEmbedding.Wasm/WasmScripts/AppManifest.js
new file mode 100644
index 0000000000..480cdd2f2e
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/WasmScripts/AppManifest.js
@@ -0,0 +1,3 @@
+var UnoAppManifest = {
+ displayName: "MauiEmbedding"
+}
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/manifest.webmanifest b/samples/MauiEmbedding/MauiEmbedding.Wasm/manifest.webmanifest
new file mode 100644
index 0000000000..eacf7b5d87
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/manifest.webmanifest
@@ -0,0 +1,10 @@
+{
+ "background_color": "#ffffff",
+ "description": "MauiEmbedding",
+ "display": "standalone",
+ "name": "MauiEmbedding",
+ "short_name": "MauiEmbedding",
+ "start_url": "/index.html",
+ "theme_color": "#ffffff",
+ "scope": "/"
+}
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/staticwebapp.config.json b/samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/staticwebapp.config.json
new file mode 100644
index 0000000000..79c1b17c4b
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/staticwebapp.config.json
@@ -0,0 +1,30 @@
+{
+ "navigationFallback": {
+ "rewrite": "/index.html",
+ "exclude": [
+ "*.{css,js}",
+ "*.{png}",
+ "*.{c,h,wasm,clr,pdb,dat,txt}"
+ ]
+ },
+ "routes": [
+ {
+ "route": "/package_*",
+ "headers": {
+ "cache-control": "public, immutable, max-age=31536000"
+ }
+ },
+ {
+ "route": "/*.ttf",
+ "headers": {
+ "cache-control": "public, immutable, max-age=31536000"
+ }
+ },
+ {
+ "route": "/*",
+ "headers": {
+ "cache-control": "must-revalidate, max-age=3600"
+ }
+ }
+ ]
+}
diff --git a/samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/web.config b/samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/web.config
new file mode 100644
index 0000000000..8f5a860f5f
--- /dev/null
+++ b/samples/MauiEmbedding/MauiEmbedding.Wasm/wwwroot/web.config
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding.sln b/samples/MauiEmbedding/MauiEmbedding.sln
index daf5cad880..7e88176025 100644
--- a/samples/MauiEmbedding/MauiEmbedding.sln
+++ b/samples/MauiEmbedding/MauiEmbedding.sln
@@ -73,6 +73,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Extensions Items", "Extensi
..\..\src\Directory.Build.props = ..\..\src\Directory.Build.props
..\..\src\Directory.Build.targets = ..\..\src\Directory.Build.targets
..\..\src\Directory.Packages.props = ..\..\src\Directory.Packages.props
+ ..\..\src\tfms-ui-maui.props = ..\..\src\tfms-ui-maui.props
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "MauiProjects", "MauiProjects", "{24511BF4-9869-4773-AF84-CC8F79AF5085}"
@@ -81,6 +82,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiControlsExternal", "Mau
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiApp1", "MauiProjects\MauiApp1\MauiApp1.csproj", "{8577882E-DA52-4D27-A529-C70998034566}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiEmbedding.Skia.Gtk", "MauiEmbedding.Skia.Gtk\MauiEmbedding.Skia.Gtk.csproj", "{00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MauiEmbedding.Wasm", "MauiEmbedding.Wasm\MauiEmbedding.Wasm.csproj", "{8BD5BF69-6C93-44BE-B31E-625636BD6423}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -875,6 +880,62 @@ Global
{8577882E-DA52-4D27-A529-C70998034566}.Release|x64.Build.0 = Release|Any CPU
{8577882E-DA52-4D27-A529-C70998034566}.Release|x86.ActiveCfg = Release|Any CPU
{8577882E-DA52-4D27-A529-C70998034566}.Release|x86.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|ARM.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|x64.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Debug|x86.Build.0 = Debug|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|ARM.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|ARM.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|ARM64.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|iPhone.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|x64.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|x64.Build.0 = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|x86.ActiveCfg = Release|Any CPU
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB}.Release|x86.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|ARM.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|ARM.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|ARM64.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|ARM64.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|iPhone.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|iPhone.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|x64.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Debug|x86.Build.0 = Debug|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|ARM.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|ARM.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|ARM64.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|ARM64.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|iPhone.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|iPhone.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|x64.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|x64.Build.0 = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|x86.ActiveCfg = Release|Any CPU
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -909,6 +970,8 @@ Global
{9F4A5914-3D10-4CDE-829C-BE53A9E441DB} = {9B9F35D5-E6DD-4FC7-9198-F8246D3CE366}
{A158CC84-0219-4BE4-A3F2-7AB7F613855A} = {24511BF4-9869-4773-AF84-CC8F79AF5085}
{8577882E-DA52-4D27-A529-C70998034566} = {24511BF4-9869-4773-AF84-CC8F79AF5085}
+ {00BAAAC1-9BA0-4F35-B7B6-5B4D64E45FAB} = {1C130CF4-EEF4-44D9-9DEF-C037FE1C221B}
+ {8BD5BF69-6C93-44BE-B31E-625636BD6423} = {1C130CF4-EEF4-44D9-9DEF-C037FE1C221B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {584E156C-C094-4968-8A1F-3FB06081E34D}
diff --git a/samples/MauiEmbedding/MauiEmbedding/App.cs b/samples/MauiEmbedding/MauiEmbedding/App.cs
index 4e25e234cc..0cb3d95ff9 100644
--- a/samples/MauiEmbedding/MauiEmbedding/App.cs
+++ b/samples/MauiEmbedding/MauiEmbedding/App.cs
@@ -1,10 +1,13 @@
-using CommunityToolkit.Maui;
using Microsoft.Maui;
+using MControls = Microsoft.Maui.Controls;
+using CommunityToolkit.Maui;
+
+#if MAUI_EMBEDDING
//using Telerik.Maui.Controls;
//using Telerik.Maui.Controls.Compatibility;
-using MControls = Microsoft.Maui.Controls;
using MauiControlsExternal;
using Esri.ArcGISRuntime.Maui;
+#endif
namespace MauiEmbedding;
@@ -21,10 +24,13 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
maui
.UseMauiCommunityToolkit()
+#if MAUI_EMBEDDING
.UseArcGISRuntime()
//.UseTelerik()
//.UseTelerikControls()
- .UseCustomLibrary();
+ .UseCustomLibrary()
+#endif
+ ;
Microsoft.Maui.Handlers.ShapeViewHandler.Mapper.AppendToMapping("BackgroundColor", (h, v) =>
{
@@ -35,6 +41,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
}
});
})
+
// Add navigation support for toolkit controls such as TabBar and NavigationView
.UseToolkitNavigation()
.Configure(host => host
@@ -98,12 +105,14 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
{
views.Register(
new ViewMap(ViewModel: typeof(ShellViewModel)),
- new ViewMap(),
- new ViewMap(),
+ new ViewMap()
+ ,new ViewMap(),
new ViewMap(),
- //new ViewMap(),
+ new ViewMap(),
new ViewMap(),
+#if MAUI_EMBEDDING
new ViewMap(),
+#endif
new ViewMap(),
new ViewMap()
);
@@ -113,13 +122,15 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
Nested: new RouteMap[]
{
new RouteMap("Main", View: views.FindByViewModel()),
- new RouteMap(nameof(MauiControlsViewModel), View: views.FindByViewModel()),
- new RouteMap(nameof(MCTControlsViewModel), View: views.FindByViewModel()),
- new RouteMap(nameof(MauiEssentialsViewModel), View: views.FindByViewModel()),
- new RouteMap(nameof(MauiColorsViewModel), View: views.FindByViewModel()),
- new RouteMap(nameof(EsriMapsViewModel), View: views.FindByViewModel()),
- new RouteMap(nameof(ExternalLibPage), View: views.FindByViewModel()),
- //new RouteMap(nameof(TelerikControlsViewModel), View: views.FindByViewModel()),
+#if MAUI_EMBEDDING
+ new RouteMap("MauiControls", View: views.FindByViewModel()),
+ new RouteMap("MCTControls", View: views.FindByViewModel()),
+ new RouteMap("MauiEssentials", View: views.FindByViewModel()),
+ new RouteMap("MauiColors", View: views.FindByViewModel()),
+ new RouteMap("EsriMaps", View: views.FindByViewModel()),
+ new RouteMap("ExternalLib", View: views.FindByViewModel()),
+ new RouteMap("TelerikControls", View: views.FindByViewModel()),
+#endif
}
)
);
diff --git a/samples/MauiEmbedding/MauiEmbedding/MauiEmbedding.csproj b/samples/MauiEmbedding/MauiEmbedding/MauiEmbedding.csproj
index be5ace9d76..f92bf770c7 100644
--- a/samples/MauiEmbedding/MauiEmbedding/MauiEmbedding.csproj
+++ b/samples/MauiEmbedding/MauiEmbedding/MauiEmbedding.csproj
@@ -4,14 +4,14 @@
$(TargetFrameworks);net7.0-windows10.0.19041
- $(TargetFrameworks);net7.0-ios;net7.0-android;net7.0-maccatalyst
+ $(TargetFrameworks);net7.0;net7.0-ios;net7.0-android;net7.0-maccatalyst
true
+ false
-
@@ -21,6 +21,9 @@
+
+
+
@@ -56,6 +59,11 @@
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding/Presentation/MainPage.xaml b/samples/MauiEmbedding/MauiEmbedding/Presentation/MainPage.xaml
index e29f9bdc96..3b91a33d71 100644
--- a/samples/MauiEmbedding/MauiEmbedding/Presentation/MainPage.xaml
+++ b/samples/MauiEmbedding/MauiEmbedding/Presentation/MainPage.xaml
@@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:uen="using:Uno.Extensions.Navigation.UI"
NavigationCacheMode="Required"
mc:Ignorable="d">
@@ -11,13 +12,13 @@
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="10">
-
-
-
-
-
-
-
+
+
+
+
+
+
+
diff --git a/samples/MauiEmbedding/MauiEmbedding/Presentation/MainViewModel.cs b/samples/MauiEmbedding/MauiEmbedding/Presentation/MainViewModel.cs
index d4b6e99611..1e9a6b8e77 100644
--- a/samples/MauiEmbedding/MauiEmbedding/Presentation/MainViewModel.cs
+++ b/samples/MauiEmbedding/MauiEmbedding/Presentation/MainViewModel.cs
@@ -19,40 +19,5 @@ public MainViewModel(
}
public string? Title { get; }
-
- public async Task GoToMauiControls()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
-
-
- public async Task GoToCommunityToolkitMauiControls()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
-
- public async Task GoToMauiEssentialsApi()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
-
- public async Task GoToTelerikPage()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
-
- public async Task GoToColorsPage()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
-
- public async Task GoToExternalLibPage()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
- public async Task GoToMapsPage()
- {
- await _navigator.NavigateViewModelAsync(this);
- }
}
diff --git a/src/Uno.Extensions.Maui.UI/GlobalUsings.cs b/src/Uno.Extensions.Maui.UI/GlobalUsings.cs
index b5b81a0133..cc83e61f97 100644
--- a/src/Uno.Extensions.Maui.UI/GlobalUsings.cs
+++ b/src/Uno.Extensions.Maui.UI/GlobalUsings.cs
@@ -4,16 +4,19 @@
global using System.Reflection;
global using Microsoft.Extensions.DependencyInjection;
global using Microsoft.Extensions.Logging;
-global using Microsoft.Maui.Controls;
-global using Microsoft.Maui.Embedding;
-global using Microsoft.Maui.Hosting;
-global using Microsoft.Maui.Platform;
global using Microsoft.UI.Xaml;
global using Microsoft.UI.Xaml.Controls;
global using Microsoft.UI.Xaml.Markup;
global using Microsoft.UI.Xaml.Media;
global using Uno.Extensions.Hosting;
+
+global using Microsoft.Maui.Controls;
+global using Microsoft.Maui.Embedding;
+global using Microsoft.Maui.Hosting;
+global using Microsoft.Maui.Platform;
+#if MAUI_EMBEDDING
global using Uno.Extensions.Maui.Internals;
+#endif
// Where there's a name conflict, alias the WinUI type with same name
global using Application = Microsoft.UI.Xaml.Application;
@@ -25,6 +28,7 @@
global using Color = Windows.UI.Color;
// Where there's a name conflict, alias Maui types with Maui prefix
+global using MauiView = Microsoft.Maui.Controls.View;
global using MauiApplication = Microsoft.Maui.Controls.Application;
global using MauiBindingMode = Microsoft.Maui.Controls.BindingMode;
global using IMauiValueConverter = Microsoft.Maui.Controls.IValueConverter;
@@ -37,4 +41,3 @@
// These types conflict with types being exposed in this package, so alias includes the namespace
global using MauiControlsBinding = Microsoft.Maui.Controls.Binding;
global using MauiGraphicsColor = Microsoft.Maui.Graphics.Color;
-
diff --git a/src/Uno.Extensions.Maui.UI/MauiBinding.cs b/src/Uno.Extensions.Maui.UI/MauiBinding.cs
index 06ddfde5ec..3bdecb711e 100644
--- a/src/Uno.Extensions.Maui.UI/MauiBinding.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiBinding.cs
@@ -36,6 +36,7 @@ public class MauiBinding : MauiExtensionBase
///
public object? Source { get; set; }
+#if MAUI_EMBEDDING
///
protected override void SetValue(View view, Type viewType, Type propertyType, BindableProperty property, string propertyName)
{
@@ -67,4 +68,5 @@ protected override void SetValue(View view, Type viewType, Type propertyType, Bi
view.SetBinding(property, binding);
}
+#endif
}
diff --git a/src/Uno.Extensions.Maui.UI/MauiColor.cs b/src/Uno.Extensions.Maui.UI/MauiColor.cs
index ab3b97da17..a91a4d3a6e 100644
--- a/src/Uno.Extensions.Maui.UI/MauiColor.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiColor.cs
@@ -12,6 +12,7 @@ public class MauiColor : MauiExtensionBase
///
public string Value { get; set; } = string.Empty;
+#if MAUI_EMBEDDING
///
protected override void SetValue(View view, Type viewType, Type propertyType, BindableProperty property, string propertyName)
{
@@ -31,4 +32,5 @@ protected override void SetValue(View view, Type viewType, Type propertyType, Bi
view.SetValue(property, color);
}
+#endif
}
diff --git a/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs b/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs
index 9f6673873a..e59e1d2051 100644
--- a/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiEmbedding.cs
@@ -6,6 +6,7 @@ namespace Uno.Extensions.Maui;
///
public static class MauiEmbedding
{
+#if MAUI_EMBEDDING
private static MauiApp? _app;
internal static IMauiContext MauiContext =>
#if ANDROID
@@ -14,6 +15,7 @@ public static class MauiEmbedding
#else
_app is not null ? new MauiContext(_app.Services)
: throw new MauiEmbeddingInitializationException();
+#endif
#endif
///
@@ -33,8 +35,9 @@ public static IApplicationBuilder UseMauiEmbedding(this IApplicationBuilder buil
///
/// The Uno app.
/// Optional lambda to configure the Maui app builder.
- public static void UseMauiEmbedding(this Microsoft.UI.Xaml.Application app, Action? configure = null)
+ public static Microsoft.UI.Xaml.Application UseMauiEmbedding(this Microsoft.UI.Xaml.Application app, Action? configure = null)
{
+#if MAUI_EMBEDDING
var mauiAppBuilder = MauiApp.CreateBuilder()
.UseMauiEmbedding();
@@ -48,6 +51,8 @@ public static void UseMauiEmbedding(this Microsoft.UI.Xaml.Application app, Acti
mauiAppBuilder.Services.AddSingleton(app)
.AddSingleton();
_app = mauiAppBuilder.Build();
+#endif
+ return app;
}
// NOTE: This was part of the POC and is out of scope for the MVP. Keeping it in case we want to add it back later.
diff --git a/src/Uno.Extensions.Maui.UI/MauiExtensionBase.cs b/src/Uno.Extensions.Maui.UI/MauiExtensionBase.cs
index 152c5fa90c..cd3c24bf4a 100644
--- a/src/Uno.Extensions.Maui.UI/MauiExtensionBase.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiExtensionBase.cs
@@ -5,6 +5,8 @@
///
public abstract class MauiExtensionBase : MarkupExtension
{
+#if MAUI_EMBEDDING
+
private ILogger? _logger;
///
@@ -12,6 +14,7 @@ public abstract class MauiExtensionBase : MarkupExtension
///
protected ILogger Logger => _logger ??= GetLogger();
+
///
protected sealed override object? ProvideValue(IXamlServiceProvider serviceProvider)
{
@@ -79,6 +82,7 @@ private ILogger GetLogger()
/// The to set.
/// The name of the property to set.
protected abstract void SetValue(View view, Type viewType, Type propertyType, BindableProperty property, string propertyName);
+#endif
///
/// Returns a default value of .
diff --git a/src/Uno.Extensions.Maui.UI/MauiHost.cs b/src/Uno.Extensions.Maui.UI/MauiHost.cs
index 7c29fbcc91..c8c8d1a470 100644
--- a/src/Uno.Extensions.Maui.UI/MauiHost.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiHost.cs
@@ -10,20 +10,24 @@ public partial class MauiHost : ContentControl
/// The MauiContent property represents the that will be used as content.
///
public static readonly DependencyProperty MauiContentProperty =
- DependencyProperty.Register(nameof(MauiContent), typeof(View), typeof(MauiHost), new PropertyMetadata(null, OnMauiContentChanged));
+ DependencyProperty.Register(nameof(MauiContent), typeof(MauiView), typeof(MauiHost), new PropertyMetadata(null, OnMauiContentChanged));
private static void OnMauiContentChanged(DependencyObject dependencyObject, DependencyPropertyChangedEventArgs args)
{
+#if MAUI_EMBEDDING
if (args.NewValue is null ||
- args.NewValue is not View view ||
+ args.NewValue is not MauiView view ||
dependencyObject is not MauiHost mauiHost)
{
return;
}
mauiHost.Content = view;
+#endif
}
+#if MAUI_EMBEDDING
+
private static ILogger GetLogger() =>
MauiEmbedding.MauiContext.Services.GetRequiredService>();
@@ -56,16 +60,19 @@ private void OnMauiContentUnloaded(object sender, RoutedEventArgs e)
}
_host = null;
}
+#endif
///
/// Gets or sets the that will be used as content.
///
- public View MauiContent
+ public MauiView MauiContent
{
- get => (View)GetValue(MauiContentProperty);
+ get => (MauiView)GetValue(MauiContentProperty);
set => SetValue(MauiContentProperty, value);
}
+#if MAUI_EMBEDDING
+
private void OnLoading(FrameworkElement sender, object args)
{
Loading -= OnLoading;
@@ -126,4 +133,5 @@ void OnDataContextChanged(FrameworkElement sender, DataContextChangedEventArgs a
_host.BindingContext = DataContext;
}
}
+#endif
}
diff --git a/src/Uno.Extensions.Maui.UI/MauiResource.cs b/src/Uno.Extensions.Maui.UI/MauiResource.cs
index a5b505eb0c..dce48923bc 100644
--- a/src/Uno.Extensions.Maui.UI/MauiResource.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiResource.cs
@@ -12,6 +12,7 @@ public class MauiResource : MauiExtensionBase
///
public string Key { get; set; } = string.Empty;
+#if MAUI_EMBEDDING
///
/// Sets the value of the view's property by the key.
///
@@ -35,4 +36,5 @@ protected override void SetValue(View view, Type viewType, Type propertyType, Bi
view.SetDynamicResource(property, Key);
}
}
+#endif
}
diff --git a/src/Uno.Extensions.Maui.UI/MauiThickness.cs b/src/Uno.Extensions.Maui.UI/MauiThickness.cs
index 2eaa4308fe..6d5793c215 100644
--- a/src/Uno.Extensions.Maui.UI/MauiThickness.cs
+++ b/src/Uno.Extensions.Maui.UI/MauiThickness.cs
@@ -11,6 +11,8 @@ public class MauiThickness : MarkupExtension
///
public string Value { get; set; } = string.Empty;
+
+#if MAUI_EMBEDDING
///
protected override object ProvideValue()
{
@@ -37,4 +39,5 @@ protected override object ProvideValue()
_ => throw new MauiEmbeddingException($"The Thickness string '{Value}' has an invalid number of arguments")
};
}
+#endif
}
diff --git a/src/Uno.Extensions.Maui.UI/Uno.Extensions.Maui.WinUI.csproj b/src/Uno.Extensions.Maui.UI/Uno.Extensions.Maui.WinUI.csproj
index 0633147482..0ed6eded6f 100644
--- a/src/Uno.Extensions.Maui.UI/Uno.Extensions.Maui.WinUI.csproj
+++ b/src/Uno.Extensions.Maui.UI/Uno.Extensions.Maui.WinUI.csproj
@@ -1,6 +1,6 @@
-
+
true
Uno.Extensions.Maui
@@ -8,6 +8,10 @@
Extensions to embed .NET MAUI controls within your Uno app.
$(WarningsNotAsErrors);CS1591
+
+ false
+ true
+ $(DefineConstants);MAUI_EMBEDDING
@@ -34,8 +38,24 @@
+
+
+
+
+
+
+ $(DefineConstants);MAUI_EMBEDDING
+
+
+
+
+
+
+
+
+
diff --git a/src/Uno.Extensions.Maui.UI/build/Package.props b/src/Uno.Extensions.Maui.UI/build/Package.props
index 163ffc3bf1..d19000a7ae 100644
--- a/src/Uno.Extensions.Maui.UI/build/Package.props
+++ b/src/Uno.Extensions.Maui.UI/build/Package.props
@@ -1,4 +1,9 @@
+
+ false
+ true
+ $(DefineConstants);MAUI_EMBEDDING
+
true
false
diff --git a/src/Uno.Extensions.Maui.UI/build/Package.targets b/src/Uno.Extensions.Maui.UI/build/Package.targets
index 286f106819..3c9fe37500 100644
--- a/src/Uno.Extensions.Maui.UI/build/Package.targets
+++ b/src/Uno.Extensions.Maui.UI/build/Package.targets
@@ -5,7 +5,7 @@
-
+
diff --git a/src/tfms-ui-maui.props b/src/tfms-ui-maui.props
index ca64be2999..b061275984 100644
--- a/src/tfms-ui-maui.props
+++ b/src/tfms-ui-maui.props
@@ -4,6 +4,7 @@
$(UnoTargetFrameworkOverride)
+ $(TargetFrameworks);net7.0;
$(TargetFrameworks);net7.0-ios
$(TargetFrameworks);net7.0-maccatalyst
$(TargetFrameworks);net7.0-android