forked from AvaloniaUI/AvaloniaMauiHybrid
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rename extension from xaml to mxaml for maui xaml files, to workaroud…
… the ava source gen issue AvaloniaUI#7 (comment)
- Loading branch information
Showing
14 changed files
with
150 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,50 @@ | ||
using Avalonia; | ||
using Avalonia.Maui; | ||
using Avalonia.Maui.Controls; | ||
using Avalonia.Maui.Handlers; | ||
using MauiSample; | ||
|
||
namespace MauiSampleApp | ||
{ | ||
public static class MauiProgram | ||
{ | ||
public static Microsoft.Maui.Hosting.MauiApp CreateMauiApp() | ||
{ | ||
var builder = Microsoft.Maui.Hosting.MauiApp.CreateBuilder(); | ||
|
||
builder.UseMauiApp<MauiApp>(); | ||
|
||
builder.UseAvalonia<AvaloniaApp>(appBuilder => | ||
{ | ||
}); | ||
|
||
builder.ConfigureFonts(fonts => | ||
{ | ||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); | ||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); | ||
}); | ||
|
||
builder.ConfigureMauiHandlers(handlers => | ||
{ | ||
#if ANDROID || IOS || WINDOWS | ||
handlers.AddHandler(typeof(AvaloniaView), typeof(AvaloniaViewHandler)); | ||
#endif | ||
}); | ||
|
||
return builder.Build(); | ||
} | ||
} | ||
using Avalonia; | ||
using Avalonia.Maui; | ||
using Avalonia.Maui.Controls; | ||
using Avalonia.Maui.Handlers; | ||
using MauiSample; | ||
using System.Collections.Immutable; | ||
|
||
[assembly: XmlnsDefinition("http://schemas.microsoft.com/dotnet/2021/maui", "Microsoft.Maui.Controls", AssemblyName = "Microsoft.Maui.Controls")] | ||
|
||
namespace MauiSampleApp | ||
{ | ||
|
||
public static class MauiProgram | ||
{ | ||
private static object DoNotOptimiceAway = ImmutableArray.Create( | ||
|
||
typeof(Microsoft.Maui.Controls.Shell), | ||
typeof(Microsoft.Maui.Controls.ContentPage), | ||
typeof(Microsoft.Maui.Controls.Application), | ||
typeof(Microsoft.Maui.Controls.ResourceDictionary) | ||
); | ||
|
||
|
||
public static Microsoft.Maui.Hosting.MauiApp CreateMauiApp() | ||
{ | ||
var builder = Microsoft.Maui.Hosting.MauiApp.CreateBuilder(); | ||
|
||
builder.UseMauiApp<MauiApp>(); | ||
|
||
builder.UseAvalonia<AvaloniaApp>(appBuilder => | ||
{ | ||
}); | ||
|
||
builder.ConfigureFonts(fonts => | ||
{ | ||
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); | ||
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); | ||
}); | ||
|
||
builder.ConfigureMauiHandlers(handlers => | ||
{ | ||
#if ANDROID || IOS || WINDOWS | ||
handlers.AddHandler(typeof(AvaloniaView), typeof(AvaloniaViewHandler)); | ||
#endif | ||
}); | ||
|
||
return builder.Build(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,99 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net7.0-android; net7.0-ios</TargetFrameworks> | ||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks> | ||
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> | ||
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> --> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>MauiSampleApp</RootNamespace> | ||
<UseMaui>true</UseMaui> | ||
<SingleProject>true</SingleProject> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
|
||
<!-- Display name --> | ||
<ApplicationTitle>MauiSample</ApplicationTitle> | ||
|
||
<!-- App Identifier --> | ||
<ApplicationId>com.companyname.mauisample</ApplicationId> | ||
<ApplicationIdGuid>EBE44A8A-128A-438D-80EF-1832A9474CB3</ApplicationIdGuid> | ||
|
||
<!-- Versions --> | ||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> | ||
<ApplicationVersion>1</ApplicationVersion> | ||
|
||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion> | ||
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> | ||
<!--<WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType>--> | ||
<!--<ApplicationManifest>Platforms\Windows\app.manifest</ApplicationManifest>--> | ||
<DefaultLanguage>en</DefaultLanguage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!-- App Icon --> | ||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" /> | ||
|
||
<!-- Splash Screen --> | ||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" /> | ||
|
||
<!-- Images --> | ||
<MauiImage Include="Resources\Images\*" /> | ||
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /> | ||
|
||
<!-- Custom Fonts --> | ||
<MauiFont Include="Resources\Fonts\*" /> | ||
|
||
<!-- Raw Assets (also remove the "Resources\Raw" prefix) --> | ||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Avalonia.Maui\Avalonia.Maui.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="MauiApp.xaml.cs"> | ||
<DependentUpon>MauiApp.xaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="AvaloniaApp.axaml.cs"> | ||
<DependentUpon>AvaloniaApp.axaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="Platforms\Windows\App.xaml.cs"> | ||
<DependentUpon>App.xaml</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<MauiXaml Update="AvaloniaCompositionPage.xaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
</MauiXaml> | ||
</ItemGroup> | ||
|
||
</Project> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net7.0-android; net7.0-ios</TargetFrameworks> | ||
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">$(TargetFrameworks);net7.0-windows10.0.19041.0</TargetFrameworks> | ||
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET --> | ||
<!-- <TargetFrameworks>$(TargetFrameworks);net7.0-tizen</TargetFrameworks> --> | ||
<OutputType>Exe</OutputType> | ||
<RootNamespace>MauiSampleApp</RootNamespace> | ||
<UseMaui>true</UseMaui> | ||
<SingleProject>true</SingleProject> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
|
||
<!-- Display name --> | ||
<ApplicationTitle>MauiSample</ApplicationTitle> | ||
|
||
<!-- App Identifier --> | ||
<ApplicationId>com.companyname.mauisample</ApplicationId> | ||
<ApplicationIdGuid>EBE44A8A-128A-438D-80EF-1832A9474CB3</ApplicationIdGuid> | ||
|
||
<!-- Versions --> | ||
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion> | ||
<ApplicationVersion>1</ApplicationVersion> | ||
|
||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion> | ||
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion> | ||
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion> | ||
<!--<WindowsPackageType Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">None</WindowsPackageType>--> | ||
<!--<ApplicationManifest>Platforms\Windows\app.manifest</ApplicationManifest>--> | ||
<DefaultLanguage>en</DefaultLanguage> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<!-- App Icon --> | ||
<MauiIcon Include="Resources\AppIcon\appicon.svg" ForegroundFile="Resources\AppIcon\appiconfg.svg" Color="#512BD4" /> | ||
|
||
<!-- Splash Screen --> | ||
<MauiSplashScreen Include="Resources\Splash\splash.svg" Color="#512BD4" BaseSize="128,128" /> | ||
|
||
<!-- Images --> | ||
<MauiImage Include="Resources\Images\*" /> | ||
<MauiImage Update="Resources\Images\dotnet_bot.svg" BaseSize="168,208" /> | ||
|
||
<!-- Custom Fonts --> | ||
<MauiFont Include="Resources\Fonts\*" /> | ||
|
||
<!-- Raw Assets (also remove the "Resources\Raw" prefix) --> | ||
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Remove="AppShell.mxaml" /> | ||
<None Remove="AvaloniaCompositionPage.mxaml" /> | ||
<None Remove="MainPage.mxaml" /> | ||
<None Remove="MauiApp.mxaml" /> | ||
<None Remove="Resources\Styles\Colors.mxaml" /> | ||
<None Remove="Resources\Styles\Styles.mxaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<MauiXaml Include="AppShell.mxaml" /> | ||
<MauiXaml Include="AvaloniaCompositionPage.mxaml"> | ||
<Generator>MSBuild:Compile</Generator> | ||
</MauiXaml> | ||
<MauiXaml Include="MainPage.mxaml" /> | ||
<MauiXaml Include="MauiApp.mxaml" /> | ||
<MauiXaml Include="Resources\Styles\Colors.mxaml" /> | ||
<MauiXaml Include="Resources\Styles\Styles.mxaml" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Avalonia.Maui\Avalonia.Maui.csproj" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<Compile Update="AppShell.mxaml.cs"> | ||
<DependentUpon>AppShell.mxaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="AvaloniaCompositionPage.mxaml.cs"> | ||
<DependentUpon>AvaloniaCompositionPage.mxaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="MainPagem.mxaml.cs"> | ||
<DependentUpon>MainPage.mxaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="MauiApp.mxaml.cs"> | ||
<DependentUpon>MauiApp.mxaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="AvaloniaApp.axaml.cs"> | ||
<DependentUpon>AvaloniaApp.axaml</DependentUpon> | ||
</Compile> | ||
<Compile Update="Platforms\Windows\App.xaml.cs"> | ||
<DependentUpon>App.xaml</DependentUpon> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
</Project> |
File renamed without changes.
File renamed without changes.