Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Embedding #1691

Merged
merged 82 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
4f3632d
feat: add Maui Embedding
dansiegel May 31, 2023
1399eb2
chore: adding basic docs for Maui Embedding
dansiegel Jun 5, 2023
cec4a98
chore: update for mvp spec
dansiegel Jun 8, 2023
ee5af2a
chore: add base sample project for Maui Embedding
dansiegel Jun 8, 2023
f13d363
chore: cleanup Maui Embedding Targets
dansiegel Jun 8, 2023
9afa41e
chore: updating sample
dansiegel Jun 12, 2023
8b77129
chore: updated Resizetizer package and add UseMauiEmbedding call
pictos Jun 12, 2023
183e643
chore: Removing 6x sdk
nickrandolph Jun 13, 2023
1ab9252
chore: Adding solution items
nickrandolph Jun 13, 2023
d34e069
chore: Adding missing windows files
nickrandolph Jun 13, 2023
48137a9
chore: Correcting directory name
nickrandolph Jun 13, 2023
6efa82c
chore: Enabling xml docs warnings
nickrandolph Jun 13, 2023
7acc6ad
docs: added inline docs for public members
pictos Jun 13, 2023
1459192
feat: added mct to the project
pictos Jun 14, 2023
4912a89
feat: created new sample pages
pictos Jun 14, 2023
e2fa2ca
feat: added Maui Essentials API page
pictos Jun 14, 2023
d46a74c
docs: added docs on how to use 3rd part maui libs
pictos Jun 14, 2023
d2060e0
fix: Windows build
nickrandolph Jun 15, 2023
16143cf
docs: Apply suggestions on HowTo docs
pictos Jun 15, 2023
eca4168
fix: Adding missing projects, moving event registration to main threa…
nickrandolph Jun 16, 2023
b3ea7fe
chore: added property that allows the projects to be build on macos
pictos Jun 16, 2023
82f111a
fix: Correcting slnf
nickrandolph Jun 19, 2023
e382c3e
fix: Disable windows build on mac
nickrandolph Jun 19, 2023
763542a
chore: Just a commit to help with some tests
pictos Jun 19, 2023
71b04db
chore: changed the sample to make sure controls are showing
pictos Jun 20, 2023
3bd1861
fix: Prevent exception on loading WinUI resources
nickrandolph Jun 21, 2023
c76e542
fix: Removing net6.0 target
nickrandolph Jun 21, 2023
83d5303
fix: Prevent invalid cast exception
nickrandolph Jun 21, 2023
63e48f1
fix: Correct missing xaml reference
nickrandolph Jun 21, 2023
af12af3
fix: Android controls working
nickrandolph Jun 21, 2023
2c65960
fix: Threading issue for accessing essential properties
nickrandolph Jun 21, 2023
e5d3781
chore: added C# controls
pictos Jun 21, 2023
2343c04
chore: added NavigationCache to don't crash during navigation
pictos Jun 21, 2023
a35d593
chore: tweaks to test on iOS
pictos Jun 21, 2023
767cd2f
fix: fixed error when building outside winUI
pictos Jun 21, 2023
590e552
chore: fixes to MCT controls to work on windows
pictos Jun 21, 2023
44d5b2f
feat: added telerik
pictos Jun 21, 2023
d41f303
fix: fixed telerik control
pictos Jun 22, 2023
3da0f48
chore: added one more layout
pictos Jun 23, 2023
ccee7bb
docs: added one report around maui.embedding
pictos Jun 23, 2023
cf3ef7f
chore: added a colors and resource page on samples
pictos Jun 23, 2023
e474239
fix: fixed wrong ! usage on if
pictos Jun 23, 2023
599ab99
chore: added more samples using Colors/Resources
pictos Jun 23, 2023
b5afe7e
chore: removed testing code
pictos Jun 23, 2023
4736ead
chore: added navigation bar to MauiColorsPage
pictos Jul 10, 2023
49e6366
chore: added embeded text color to the test
pictos Jul 11, 2023
76f893e
chore: adding more test cases for MauiBinding
pictos Jul 11, 2023
9f81b41
fix: Make sure the DataContext is passing to UnoHost
pictos Jul 11, 2023
d780aaa
chore: created MauiApp for testing
pictos Jul 11, 2023
3202d7c
chore: added External Maui lib to the Maui project
pictos Jul 11, 2023
e67bb81
chore: some tweaks for the mauiexternal
pictos Jul 12, 2023
32220c0
chore: added mauiexternal control reference
pictos Jul 12, 2023
7e8a43d
fix: Update to net7.0 after rebase
nickrandolph Jul 13, 2023
a8bd300
fix: fixed Maui projects
pictos Jul 13, 2023
56e69a2
fix: Package versions
nickrandolph Jul 14, 2023
e232b04
fix: fixed runtime crash on mobile targets
pictos Jul 14, 2023
a187b9f
chore: added telerik controls back
pictos Jul 15, 2023
92d6439
fix: fixed bindingContext on UnoHost
pictos Jul 17, 2023
950ba41
docs: fixes
nickrandolph Jul 17, 2023
b56f10f
docs: fixes
nickrandolph Jul 17, 2023
0397a69
docs: fixes
nickrandolph Jul 17, 2023
342cf4d
docs: fixes
nickrandolph Jul 17, 2023
c507f9d
chore: updated vsmac slnf
pictos Jul 17, 2023
ffea0de
chore: added flag to control when to use Telerik or not
pictos Jul 17, 2023
b451b3c
fix: fixed BindingContext not being propagated to its children
pictos Jul 19, 2023
4c464a4
chore: updated sample to match the fixes
pictos Jul 19, 2023
987b729
fix: updated Package.props file
pictos Jul 21, 2023
c48cce5
chore: added SkiaShpar files on the csproj
pictos Jul 21, 2023
aeadee0
chore: added telerik on maui controls
pictos Jul 21, 2023
631f327
fix: fixed extra projects on sln
pictos Jul 21, 2023
3f506ea
fix: fixed Telerik packages
pictos Jul 21, 2023
4050fba
feat: added Esri maps sample and package
pictos Jul 22, 2023
c38e5fb
fix: removed telerik references until skiasharp releases new package
pictos Jul 22, 2023
b271cd0
chore: Used records instead of tuples
pictos Jul 25, 2023
e94bdbc
chore: Removing issues file
nickrandolph Jul 25, 2023
0b663ce
chore(deps): Updating to latest preview for skiasharp
nickrandolph Jul 25, 2023
44da710
chore(deps): updating uno
nickrandolph Jul 25, 2023
f98a493
chore: Adding maui workloads
nickrandolph Jul 25, 2023
5072767
fix: Restructuring maui projects
nickrandolph Jul 25, 2023
42dd24a
chore: Disable xml doc errors
nickrandolph Jul 25, 2023
ee64140
chore: Switching order of workload installs
nickrandolph Jul 25, 2023
5cbf98e
fix: Direct reference to Uno.WinUI for extension packages
nickrandolph Jul 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
<Build_Android>true</Build_Android>
<Build_iOS>true</Build_iOS>
<Build_MacOS>true</Build_MacOS>
<Build_Windows>true</Build_Windows>
<Build_Windows Condition="$([MSBuild]::IsOSPlatform('windows'))">true</Build_Windows>
<Build_Windows Condition="!$([MSBuild]::IsOSPlatform('windows'))">false</Build_Windows>
</PropertyGroup>

<Import Project="DebugPlatforms.props" Condition="exists('DebugPlatforms.props')" />
Expand Down
5 changes: 5 additions & 0 deletions build/ci/templates/dotnet-install-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,8 @@ steps:
errorActionPreference: continue
ignoreLASTEXITCODE: true
retryCountOnTaskFailure: 3

- powershell: |
dotnet workload install maui --source https://api.nuget.org/v3/index.json
dotnet workload install android ios maccatalyst tvos macos maui wasm-tools --source https://api.nuget.org/v3/index.json
displayName: Maui workloads
92 changes: 92 additions & 0 deletions doc/Learn/Tutorials/Maui/HowTo-Use3rdPartLibs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
---
uid: Learn.Tutorials.Maui.HowToUse3rdPartLibs
---

# How-To: Install and use third part libraries on Uno apps with Maui Embedding

When working in an application project, you may need to install a third party library. This guide will show you how to install and use a third party library in your Uno app with Maui Embedding.

For this sample we will use the `CommunityToolkit.Maui` library.

## Step-by-steps

### 1. Installing the NuGet package

On Visual Studio you can use the `Nuget Package Manager` to install the `CommunityToolkit.Maui` package. Install it on your class library project and mobile and Windows project (because this package support those platforms).

To verify if the package is installed you can look on your csproj file and check if the package is there. It should be something like this:

```xml
<ItemGroup>
<PackageReference Include="CommunityToolkit.Maui" Version="2.0.0" />
</ItemGroup>
```

### 2. Using the library

In order to use the library we need to initialize it, we do that during the app initialization. So go to your `App.cs` file and add the following code:

```csharp
using using CommunityToolkit.Maui;

protected async override void OnLaunched(LaunchActivatedEventArgs args)
{
var builder = this.CreateBuilder(args)
.UseMauiEmbedding(maui =>
{
maui.UseMauiCommunityToolkit();
})
// the rest of your configuration
}
```

> [!INFO]
> If you are using other libraries that targets .NET MAUI and requires initialization, you can do it inside the lambda function on `UseMauiEmbedding` call.

Now let's use it on our Page. For that you have to open your XAML page and add the necessary namespaces and the controls you want to use. In this sample we will use the `DrawingView` control.

```xml
<Page
x:Class="MauiEmbedding.Presentation.MCTControlsPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:uem="using:Uno.Extensions.Maui"
xmlns:local="using:MauiEmbedding.Presentation"
xmlns:maui="using:Microsoft.Maui.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:uen="using:Uno.Extensions.Navigation.UI"
xmlns:utu="using:Uno.Toolkit.UI"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
NavigationCacheMode="Required"
mc:Ignorable="d">

<StackPanel
HorizontalAlignment="Center"
VerticalAlignment="Center">
<embed:MauiContent>
<maui:ScrollView>
<maui:ScrollView.Content>
<maui:VerticalStackLayout Spacing="16">
<toolkit:DrawingView
HeightRequest="300"
IsMultiLineModeEnabled="true"
LineColor="{embed:MauiColor Value='#FF0000'}"
LineWidth="5"
WidthRequest="300" />
</maui:VerticalStackLayout>
</maui:ScrollView.Content>
</maui:ScrollView>
</embed:MauiContent>
</StackPanel>
</Page>
```

Let's take a moment and review this piece of code. First we added the `toolkit` namespace, this is the namespace that contains the controls from the `CommunityToolkit.Maui` library. In order to consume the `DrawingView` control. We need to use the `MauiContent` control, that lives on `uem` namespace, this control holds all the .NET MAUI types (layouts, controls, converters, etc), you can't use .NET MAUI types outside this control.

Also, Uno Platform does not convert the `Color` type from .NET MAUI to the WinUI `Color`, so we need to use the `MauiColor` markup extension for the conversion, as you can see in the `LineColor` property.

### 3. Conclusion

At this point, running the app should show the `DrawingView` control and allow interactions with it.
88 changes: 88 additions & 0 deletions doc/Overview/Maui/MauiOverview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
uid: Overview.Maui
---
# .NET Maui Embedding

.NET Maui Embedding provides limited support for Uno Applications to make use of 3rd party control libraries when the required app platforms match one of those available from .NET MAUI.

## Initialization

After installing the `Uno.Extensions.Maui.WinUI` NuGet package you will need to update your App.cs in the core/shared project of your Uno Platform Project.

```cs
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
this.UseMauiEmbedding();
}
```

Similarly if you are using Uno.Extensions.Hosting for Dependency Injection you can call the `UseMauiEmbedding()` extension off of the `IApplicationBuilder` like:

```cs
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
var builder = this.CreateBuilder(args)
.UseMauiEmbedding();
}
```

In the event that your 3rd party control library requires initialization on the `MauiAppBuilder` you can initialize those libraries by simply providing a delegate for the `MauiAppBuilder` in the `UseMauiEmbedding()` extension method:

```cs
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
var builder = this.CreateBuilder(args)
.UseMauiEmbedding(maui => maui
.UseTelerikControls())
}
```

## Getting Started

With Maui Initialized we are now able to make use of the MauiContent control provided by Uno.Extensions.Maui.WinUI.

```xml
<Page x:Class="DemoTelerikApp.Presentation.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:embed="using:Uno.Extensions.Maui"
xmlns:maui="using:Microsoft.Maui.Controls"
Background="{ThemeResource BackgroundBrush}">

<embed:MauiContent>
<maui:Label Text="Hello From .NET MAUI &amp; Uno Platform" />
</embed:MauiContent>
</Page>
```

### Resources & Styles

When the MauiContent is created it will walk the Visual Tree and look for any parents including `Application.Current` which have a ResourceDictionary which has Resources and/or Styles. It will then do it's best to bring these over to the available MAUI Resources. This includes being able to reuse Colors, Brushes, Thickness, and Converters as well as some limited support for Styles.

### XAML Extensions

There are several XAML Extensions that you may decide to make use of while building an app with .NET MAUI Embedding.

- MauiBinding - As the name suggests this will allow you to create a binding to your DataContext. **NOTE** You can not use `x:Bind` or `Binding` on a MAUI Control.
- MauiColor: If you want to be able to directly apply a Hex string or `Color` name to a `Color` property on a MAUI Control you can use the `MauiColor` Extension to provide that value.
- MauiThickness: If you want to be able to directly apply a `Thickness`, you can use the `MauiThickness` extension to provide a value like `10`, `10,20`, or `10,20,10,5`
- MauiResource: As explained in the previous section, the `MauiContent` control will bring over the WinUI Resources automatically to make it easier to provide consistent styling even within the `MauiContent` of your View. This will allow you to provide a resource Key to apply to a given property.

```xml
<maui:VerticalStackLayout BackgroundColor="{embed:MauiColor Value='#ABABAB'}">
<maui:Label Text="{embed:MauiBinding Path='Message'}" />
</maui:VerticalStackLayout>
```

### Limitations and Known issues

- Some controls like the `ScrollView` from .NET MAUI will not have the `Content` property automatically recognized by the XAML compiler. As a result you will need to be more verbose with these controls like:
```xml
<ScrollView>
<ScrollView.Content>
<!-- My Content -->
</ScrollView.Content>
</ScrollView>
```
- Common type conversions such as hex string or color name to Maui Graphics Color will not work with the XAML Compiler. Similarly types like Thickness `10` or `10,20` will not be picked up and converted by the XAML Compiler. For these primitive types especially it is recommended to simply provide a WinUI Thickness or Color in your Resource Dictionary. These native types will be automatically converted to MAUI types and available to use with the `MauiResource` XAML Extension.
- .NET MAUI Hot Reload will throw an exception and cause the app the crash. You will need to disable this in Visual Studio for now.
15 changes: 15 additions & 0 deletions samples/MauiEmbedding/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to find out which attributes exist for C# debugging
// Use hover for the description of the existing attributes
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
"version": "0.2.0",
"configurations": [
{
"name": "Uno Platform Mobile",
"type": "Uno",
"request": "launch",
// any Uno* task will do, this is simply to satisfy vscode requirement when a launch.json is present
"preLaunchTask": "Uno: android | Debug | android-x64"
},
]
}
56 changes: 56 additions & 0 deletions samples/MauiEmbedding/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<Project>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

<DebugType>portable</DebugType>
<DebugSymbols>True</DebugSymbols>

<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
<WarningsNotAsErrors>NU1009</WarningsNotAsErrors>
<NoWarn>$(NoWarn);CA1416;NU1507;NU1009</NoWarn>

<DefaultLanguage>en</DefaultLanguage>

<IsAndroid>false</IsAndroid>
<IsIOS>false</IsIOS>
<IsMac>false</IsMac>
<IsMacCatalyst>false</IsMacCatalyst>
<IsWinAppSdk>false</IsWinAppSdk>
<_UseTelerik>false</_UseTelerik>
</PropertyGroup>

<Choose>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">
<PropertyGroup>
<IsAndroid>true</IsAndroid>
<SupportedOSPlatformVersion>21.0</SupportedOSPlatformVersion>
</PropertyGroup>
</When>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">
<PropertyGroup>
<IsIOS>true</IsIOS>
<SupportedOSPlatformVersion>14.2</SupportedOSPlatformVersion>
</PropertyGroup>
</When>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'macos'">
<PropertyGroup>
<IsMac>true</IsMac>
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
</PropertyGroup>
</When>
<When Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<PropertyGroup>
<IsMacCatalyst>true</IsMacCatalyst>
<SupportedOSPlatformVersion>14.0</SupportedOSPlatformVersion>
</PropertyGroup>
</When>
<When Condition="$(TargetFramework.Contains('windows10'))">
<PropertyGroup>
<IsWinAppSdk>true</IsWinAppSdk>
<SupportedOSPlatformVersion>10.0.18362.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion>10.0.18362.0</TargetPlatformMinVersion>
</PropertyGroup>
</When>
</Choose>
</Project>
6 changes: 6 additions & 0 deletions samples/MauiEmbedding/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<Project>
<ItemGroup>
<!-- Removes native usings to avoid Ambiguous reference -->
<Using Remove="@(Using->HasMetadata('Platform'))" />
</ItemGroup>
</Project>
25 changes: 25 additions & 0 deletions samples/MauiEmbedding/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project ToolsVersion="15.0">
<ItemGroup>
<PackageVersion Include="CommunityToolkit.Mvvm" Version="8.2.0" />
<PackageVersion Include="Microsoft.Extensions.Logging.Console" Version="7.0.0" />
<PackageVersion Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.756" />
<PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.3.230602002" />
<PackageVersion Include="SkiaSharp" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.Views.Uno.WinUI" Version="2.88.4-preview.89" />
<PackageVersion Include="SkiaSharp.NativeAssets.iOS" Version="2.88.4-preview.89" />
<PackageVersion Include="Uno.Core.Extensions.Logging.Singleton" Version="4.0.1" />
<PackageVersion Include="Uno.Extensions.Logging.OSLog" Version="1.4.0" />
<PackageVersion Include="Uno.Material.WinUI" Version="3.0.0-dev.262" />
<PackageVersion Include="Uno.Dsp.Tasks" Version="1.1.0" />
<PackageVersion Include="Uno.Toolkit.WinUI" Version="3.1.0-dev.24" />
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="3.1.0-dev.24" />
<PackageVersion Include="Uno.Resizetizer" Version="1.2.0-dev.13" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.WinUI" Version="5.0.0-dev.1610" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="5.0.0-dev.1610" />
<PackageVersion Include="CommunityToolkit.Maui" Version="2.0.0" />
<PackageVersion Include="Telerik.UI.for.Maui" Version="5.1.0" Condition="$(_UseTelerik)" />
<PackageVersion Include="Esri.ArcGISRuntime.Maui" Version="200.1.0" />
</ItemGroup>
</Project>
36 changes: 36 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding-vsmac.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"solution": {
"path": "MauiEmbedding.sln",
"projects": [
"..\\..\\src\\Uno.Extensions.Configuration\\Uno.Extensions.Configuration.csproj",
"..\\..\\src\\Uno.Extensions.Core.Generators\\Uno.Extensions.Core.Generators.csproj",
"..\\..\\src\\Uno.Extensions.Core.UI\\Uno.Extensions.Core.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Core\\Uno.Extensions.Core.csproj",
"..\\..\\src\\Uno.Extensions.Hosting.UI\\Uno.Extensions.Hosting.WinUI.Skia.csproj",
"..\\..\\src\\Uno.Extensions.Hosting.UI\\Uno.Extensions.Hosting.WinUI.Wasm.csproj",
"..\\..\\src\\Uno.Extensions.Hosting.UI\\Uno.Extensions.Hosting.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Hosting\\Uno.Extensions.Hosting.csproj",
"..\\..\\src\\Uno.Extensions.Localization.UI\\Uno.Extensions.Localization.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Localization\\Uno.Extensions.Localization.csproj",
"..\\..\\src\\Uno.Extensions.Logging.Serilog\\Uno.Extensions.Logging.Serilog.csproj",
"..\\..\\src\\Uno.Extensions.Logging\\Uno.Extensions.Logging.WinUI.Skia.csproj",
"..\\..\\src\\Uno.Extensions.Logging\\Uno.Extensions.Logging.WinUI.Wasm.csproj",
"..\\..\\src\\Uno.Extensions.Logging\\Uno.Extensions.Logging.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Maui.UI\\Uno.Extensions.Maui.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Navigation.Generators\\Uno.Extensions.Navigation.Generators.csproj",
"..\\..\\src\\Uno.Extensions.Navigation.Toolkit\\Uno.Extensions.Navigation.Toolkit.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Navigation.UI\\Uno.Extensions.Navigation.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Navigation\\Uno.Extensions.Navigation.csproj",
"..\\..\\src\\Uno.Extensions.Serialization\\Uno.Extensions.Serialization.csproj",
"..\\..\\src\\Uno.Extensions.Storage.UI\\Uno.Extensions.Storage.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Storage\\Uno.Extensions.Storage.csproj",
"..\\..\\src\\Uno.Extensions.Toolkit.UI\\Uno.Extensions.Toolkit.WinUI.csproj",
"..\\..\\src\\Uno.Extensions.Toolkit\\Uno.Extensions.Toolkit.csproj",
"..\\..\\src\\Uno.Extensions\\Uno.Extensions.csproj",
"..\\MauiProjects\\MauiApp1\\MauiApp1.csproj",
"..\\MauiProjects\\MauiControlsExternal\\MauiControlsExternal.csproj",
"MauiEmbedding.Mobile\\MauiEmbedding.Mobile.csproj",
"MauiEmbedding\\MauiEmbedding.csproj"
]
}
}
17 changes: 17 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Base/AppHead.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<local:App x:Class="MauiEmbedding.AppHead"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:wasm="http://platform.uno/wasm"
xmlns:local="using:MauiEmbedding"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="wasm">

<local:App.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ms-appx:///MauiEmbedding/AppResources.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</local:App.Resources>

</local:App>
28 changes: 28 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Base/AppHead.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using Microsoft.UI.Xaml;
using Uno.Resizetizer;

namespace MauiEmbedding;

public sealed partial class AppHead : App
{
/// <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 AppHead()
{
this.InitializeComponent();
}

/// <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="args">Details about the launch request and process.</param>
protected override void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);

MainWindow.SetWindowIcon();
}
}
Loading