-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Base class changed to Rectangle & fix DefaultBackgroundColor
Improvement example project
- Loading branch information
Showing
20 changed files
with
299 additions
and
85 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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
using System.Reflection; | ||
|
||
[assembly: AssemblyVersion("255.255.255.255")] |
42 changes: 42 additions & 0 deletions
42
src/Avalonia.Ref/Avalonia.Desktop/AppBuilderDesktopExtensions.cs
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using Avalonia.Controls; | ||
using Avalonia.Platform; | ||
|
||
// https://github.com/AvaloniaUI/Avalonia/blob/0.10.13/src/Avalonia.Desktop/AppBuilderDesktopExtensions.cs | ||
|
||
namespace Avalonia | ||
{ | ||
public static class AppBuilderDesktopExtensions | ||
{ | ||
public static TAppBuilder UsePlatformDetect<TAppBuilder>(this TAppBuilder builder) | ||
where TAppBuilder : AppBuilderBase<TAppBuilder>, new() | ||
{ | ||
#if WINDOWS | ||
builder.UseWin32(); | ||
#else | ||
var os = builder.RuntimePlatform.GetRuntimeInfo().OperatingSystem; | ||
|
||
// We don't have the ability to load every assembly right now, so we are | ||
// stuck with manual configuration here | ||
// Helpers are extracted to separate methods to take the advantage of the fact | ||
// that CLR doesn't try to load dependencies before referencing method is jitted | ||
// Additionally, by having a hard reference to each assembly, | ||
// we verify that the assemblies are in the final .deps.json file | ||
// so .NET Core knows where to load the assemblies from,. | ||
switch (os) | ||
{ | ||
case OperatingSystemType.WinNT: | ||
builder.UseWin32(); | ||
break; | ||
case OperatingSystemType.OSX: | ||
builder.UseAvaloniaNative(); | ||
break; | ||
default: | ||
builder.UseX11(); | ||
break; | ||
} | ||
#endif | ||
builder.UseSkia(); | ||
return builder; | ||
} | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;net6.0-windows</TargetFrameworks> | ||
<SignAssembly>true</SignAssembly> | ||
<DelaySign>false</DelaySign> | ||
<AssemblyOriginatorKeyFile>..\avalonia.snk</AssemblyOriginatorKeyFile> | ||
<!--https://github.com/AvaloniaUI/Avalonia/blob/0.10.10/build/SharedVersion.props#L18--> | ||
<IsTrimmable>true</IsTrimmable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\AssemblyInfo.Version.Max.cs"> | ||
<LinkBase>Properties</LinkBase> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia.Win32" /> | ||
<PackageReference Include="Avalonia.Skia" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup Condition=" !$(TargetFramework.Contains('-windows')) "> | ||
<PackageReference Include="Avalonia.X11" /> | ||
<PackageReference Include="Avalonia.Native" /> | ||
</ItemGroup> | ||
|
||
</Project> |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFrameworks>net6.0;net6.0-windows</TargetFrameworks> | ||
<SignAssembly>true</SignAssembly> | ||
<DelaySign>false</DelaySign> | ||
<AssemblyOriginatorKeyFile>..\avalonia.snk</AssemblyOriginatorKeyFile> | ||
<!--https://github.com/AvaloniaUI/Avalonia/blob/0.10.10/build/SharedVersion.props#L18--> | ||
<IsTrimmable>true</IsTrimmable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\AssemblyInfo.Version.Max.cs"> | ||
<LinkBase>Properties</LinkBase> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" /> | ||
</ItemGroup> | ||
|
||
</Project> |
17 changes: 17 additions & 0 deletions
17
src/Avalonia.Ref/Avalonia.Native/AvaloniaNativePlatformExtensions.cs
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#if !WINDOWS | ||
|
||
using System; | ||
using Avalonia.Controls; | ||
|
||
namespace Avalonia | ||
{ | ||
public static class AvaloniaNativePlatformExtensions | ||
{ | ||
public static T UseAvaloniaNative<T>(this T builder) where T : AppBuilderBase<T>, new() | ||
{ | ||
throw new PlatformNotSupportedException(); | ||
} | ||
} | ||
} | ||
|
||
#endif |
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<SignAssembly>true</SignAssembly> | ||
<DelaySign>false</DelaySign> | ||
<AssemblyOriginatorKeyFile>..\avalonia.snk</AssemblyOriginatorKeyFile> | ||
<!--https://github.com/AvaloniaUI/Avalonia/blob/0.10.10/build/SharedVersion.props#L18--> | ||
<IsTrimmable>true</IsTrimmable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Include="..\AssemblyInfo.Version.Max.cs"> | ||
<LinkBase>Properties</LinkBase> | ||
</Compile> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Avalonia" /> | ||
</ItemGroup> | ||
|
||
</Project> |
17 changes: 17 additions & 0 deletions
17
src/Avalonia.Ref/Avalonia.X11/AvaloniaX11PlatformExtensions.cs
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#if !WINDOWS | ||
|
||
using System; | ||
using Avalonia.Controls; | ||
|
||
namespace Avalonia | ||
{ | ||
public static class AvaloniaX11PlatformExtensions | ||
{ | ||
public static T UseX11<T>(this T builder) where T : AppBuilderBase<T>, new() | ||
{ | ||
throw new PlatformNotSupportedException(); | ||
} | ||
} | ||
} | ||
|
||
#endif |
Binary file not shown.
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
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
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
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
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,6 +1,3 @@ | ||
using Microsoft.Win32; | ||
using System.Windows; | ||
|
||
namespace Avalonia.WebView2.Sample; | ||
|
||
static class Program | ||
|
Oops, something went wrong.