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

fix: Adding net7.0 support for maui package #1704

Merged
merged 3 commits into from
Jul 28, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
48 changes: 25 additions & 23 deletions samples/MauiEmbedding/Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
<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>
<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="SkiaSharp.Skottie" 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.Skia.Gtk" 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>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType Condition="'$(Configuration)'=='Release'">WinExe</OutputType>
<OutputType Condition="'$(Configuration)'=='Debug'">Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<EmbeddedResource Include="Package.appxmanifest" />
<Manifest Include="$(ApplicationManifest)" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Uno.WinUI.Skia.Gtk" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" />
<PackageReference Include="SkiaSharp.Views.Uno.WinUI" />
<PackageReference Include="SkiaSharp.Skottie" />
<PackageReference Include="Uno.WinUI.RemoteControl" Condition="'$(Configuration)'=='Debug'" />
<PackageReference Include="Uno.UI.Adapter.Microsoft.Extensions.Logging" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MauiEmbedding\MauiEmbedding.csproj" />
</ItemGroup>
<Import Project="..\MauiEmbedding.Base\base.props" />
</Project>
43 changes: 43 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities"
IgnorableNamespaces="uap rescap">

<Identity
Name="MauiEmbedding"
Publisher="O=MauiEmbedding"
Version="1.0.0.0" />

<Properties>
<DisplayName>MauiEmbedding</DisplayName>
<PublisherDisplayName>MauiEmbedding</PublisherDisplayName>
</Properties>

<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.17763.0" MaxVersionTested="10.0.19041.0" />
</Dependencies>

<Resources>
<Resource Language="x-generate"/>
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="MauiEmbedding"
Description="MauiEmbedding">
<uap:SplashScreen />
</uap:VisualElements>
</Application>
</Applications>

<Capabilities>
<rescap:Capability Name="runFullTrust" />
</Capabilities>
</Package>
21 changes: 21 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/Program.cs
Original file line number Diff line number Diff line change
@@ -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();
}
}
77 changes: 77 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.Skia.Gtk/app.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MauiEmbedding.Gtk"/>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
<!-- UAC Manifest Options
If you want to change the Windows User Account Control level replace the
requestedExecutionLevel node with one of the following.

<requestedExecutionLevel level="asInvoker" uiAccess="false" />
<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
<requestedExecutionLevel level="highestAvailable" uiAccess="false" />

Specifying requestedExecutionLevel element will disable file and registry virtualization.
Remove this element if your application requires this virtualization for backwards
compatibility.
-->
<requestedExecutionLevel level="asInvoker" uiAccess="false" />
</requestedPrivileges>
</security>
</trustInfo>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- A list of the Windows versions that this application has been tested on
and is designed to work with. Uncomment the appropriate elements
and Windows will automatically select the most compatible environment. -->

<!-- Windows Vista -->
<!--<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}" />-->

<!-- Windows 7 -->
<!--<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}" />-->

<!-- Windows 8 -->
<!--<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}" />-->

<!-- Windows 8.1 -->
<!--<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}" />-->

<!-- Windows 10 -->
<!--<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />-->

</application>
</compatibility>

<!-- Indicates that the application is DPI-aware and will not be automatically scaled by Windows at higher
DPIs. Windows Presentation Foundation (WPF) applications are automatically DPI-aware and do not need
to opt in. Windows Forms applications targeting .NET Framework 4.6 that opt into this setting, should
also set the 'EnableWindowsFormsHighDpiAutoResizing' setting to 'true' in their app.config. -->

<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness>
</windowsSettings>
</application>


<!-- Enable themes for Windows common controls and dialogs (Windows XP and later) -->
<!--
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
-->

</assembly>
32 changes: 32 additions & 0 deletions samples/MauiEmbedding/MauiEmbedding.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -81,6 +82,8 @@ 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
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -875,6 +878,34 @@ 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
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -909,6 +940,7 @@ 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}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {584E156C-C094-4968-8A1F-3FB06081E34D}
Expand Down
28 changes: 18 additions & 10 deletions samples/MauiEmbedding/MauiEmbedding/App.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
#if MAUI_EMBEDDING
using CommunityToolkit.Maui;
using Microsoft.Maui;
//using Telerik.Maui.Controls;
//using Telerik.Maui.Controls.Compatibility;
using MControls = Microsoft.Maui.Controls;
using MauiControlsExternal;
using Esri.ArcGISRuntime.Maui;
#endif

namespace MauiEmbedding;

Expand All @@ -16,6 +18,7 @@ public class App : Application
protected async override void OnLaunched(LaunchActivatedEventArgs args)
{
var builder = this.CreateBuilder(args)
#if MAUI_EMBEDDING
.UseMauiEmbedding(maui =>
{

Expand All @@ -35,6 +38,7 @@ protected async override void OnLaunched(LaunchActivatedEventArgs args)
}
});
})
#endif
// Add navigation support for toolkit controls such as TabBar and NavigationView
.UseToolkitNavigation()
.Configure(host => host
Expand Down Expand Up @@ -98,28 +102,32 @@ private static void RegisterRoutes(IViewRegistry views, IRouteRegistry routes)
{
views.Register(
new ViewMap(ViewModel: typeof(ShellViewModel)),
new ViewMap<MainPage, MainViewModel>(),
new ViewMap<MauiControlsPage, MauiControlsViewModel>(),
new ViewMap<MainPage, MainViewModel>()
#if MAUI_EMBEDDING
,new ViewMap<MauiControlsPage, MauiControlsViewModel>(),
new ViewMap<MauiEssentialsPage, MauiEssentialsViewModel>(),
//new ViewMap<TelerikControlsPage, TelerikControlsViewModel>(),
new ViewMap<TelerikControlsPage, TelerikControlsViewModel>(),
new ViewMap<MauiColorsPage, MauiColorsViewModel>(),
new ViewMap<EsriMapsPage, EsriMapsViewModel>(),
new ViewMap<ExternalLibPage, ExternalLibViewModel>(),
new ViewMap<MCTControlsPage, MCTControlsViewModel>()
#endif
);

routes.Register(
new RouteMap("", View: views.FindByViewModel<ShellViewModel>(),
Nested: new RouteMap[]
{
new RouteMap("Main", View: views.FindByViewModel<MainViewModel>()),
new RouteMap(nameof(MauiControlsViewModel), View: views.FindByViewModel<MauiControlsViewModel>()),
new RouteMap(nameof(MCTControlsViewModel), View: views.FindByViewModel<MCTControlsViewModel>()),
new RouteMap(nameof(MauiEssentialsViewModel), View: views.FindByViewModel<MauiEssentialsViewModel>()),
new RouteMap(nameof(MauiColorsViewModel), View: views.FindByViewModel<MauiColorsViewModel>()),
new RouteMap(nameof(EsriMapsViewModel), View: views.FindByViewModel<EsriMapsViewModel>()),
new RouteMap(nameof(ExternalLibPage), View: views.FindByViewModel<ExternalLibViewModel>()),
//new RouteMap(nameof(TelerikControlsViewModel), View: views.FindByViewModel<TelerikControlsViewModel>()),
#if MAUI_EMBEDDING
nickrandolph marked this conversation as resolved.
Show resolved Hide resolved
new RouteMap("MauiControls", View: views.FindByViewModel<MauiControlsViewModel>()),
new RouteMap("MCTControls", View: views.FindByViewModel<MCTControlsViewModel>()),
new RouteMap("MauiEssentials", View: views.FindByViewModel<MauiEssentialsViewModel>()),
new RouteMap("MauiColors", View: views.FindByViewModel<MauiColorsViewModel>()),
new RouteMap("EsriMaps", View: views.FindByViewModel<EsriMapsViewModel>()),
new RouteMap("ExternalLib", View: views.FindByViewModel<ExternalLibViewModel>()),
new RouteMap("TelerikControls", View: views.FindByViewModel<TelerikControlsViewModel>()),
#endif
}
)
);
Expand Down
Loading