Skip to content

Commit

Permalink
chore: add base sample project for Maui Embedding
Browse files Browse the repository at this point in the history
  • Loading branch information
dansiegel authored and nickrandolph committed Jul 25, 2023
1 parent cec4a98 commit ee5af2a
Show file tree
Hide file tree
Showing 57 changed files with 2,920 additions and 0 deletions.
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"
},
]
}
55 changes: 55 additions & 0 deletions samples/MauiEmbedding/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<Project>
<PropertyGroup>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>

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

<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>

<NoWarn>$(NoWarn);CA1416;NU1507</NoWarn>

<DefaultLanguage>en</DefaultLanguage>

<IsAndroid>false</IsAndroid>
<IsIOS>false</IsIOS>
<IsMac>false</IsMac>
<IsMacCatalyst>false</IsMacCatalyst>
<IsWinAppSdk>false</IsWinAppSdk>
</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>
21 changes: 21 additions & 0 deletions samples/MauiEmbedding/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<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.230502000" />
<!-- Use previous version for unpackaged apps due to build issue https://github.com/microsoft/WindowsAppSDK/issues/3591 -->
<!-- <PackageVersion Include="Microsoft.WindowsAppSDK" Version="1.2.230313.1" /> -->
<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="2.6.1" />
<PackageVersion Include="Uno.Dsp.Tasks" Version="1.1.0" />
<PackageVersion Include="Uno.Toolkit.WinUI" Version="3.0.4" />
<PackageVersion Include="Uno.Toolkit.WinUI.Material" Version="3.0.4" />
<PackageVersion Include="Uno.Resizetizer" Version="1.1.0" />
<PackageVersion Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" Version="4.9.20" />
<PackageVersion Include="Uno.UniversalImageLoader" Version="1.9.36" />
<PackageVersion Include="Uno.WinUI" Version="4.9.20" />
<PackageVersion Include="Uno.WinUI.RemoteControl" Version="4.9.20" />
</ItemGroup>
</Project>
9 changes: 9 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding-vsmac.slnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"solution": {
"path": "MauiEmbedding.sln",
"projects": [
"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();
}
}
137 changes: 137 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Base/Icons/appconfig.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Base/Icons/iconapp.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit ee5af2a

Please sign in to comment.