Upgrade Avalonia packages and fixed some of issues with this upgrade.
This commit is contained in:
+34
-33
@@ -1,35 +1,36 @@
|
||||
<Project>
|
||||
<!-- https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management -->
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<Version>1.1.1.0</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- Avalonia packages -->
|
||||
<!-- Important: keep version in sync! -->
|
||||
<PackageVersion Include="Avalonia" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.AvaloniaEdit" Version="11.4.1" />
|
||||
<PackageVersion Include="Avalonia.Themes.Fluent" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.Fonts.Inter" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.iOS" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.Browser" Version="11.3.12" />
|
||||
<PackageVersion Include="Avalonia.Android" Version="11.3.12" />
|
||||
<PackageVersion Include="AvaloniaEdit.TextMate" Version="11.4.1" />
|
||||
<PackageVersion Include="Deadpikle.AvaloniaProgressRing" Version="0.10.11-preview20251127001" />
|
||||
<PackageVersion Include="DialogHost.Avalonia" Version="0.10.4" />
|
||||
<PackageVersion Include="Jint" Version="4.5.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="11.0.0-preview.1.26104.118" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="11.0.0-preview.1.26104.118" />
|
||||
<PackageVersion Include="Microsoft.Maui.Graphics" Version="10.0.11" />
|
||||
<PackageVersion Include="Microsoft.Maui.Graphics.Skia" Version="10.0.11" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageVersion Include="PanAndZoom" Version="11.3.9.1" />
|
||||
<PackageVersion Include="SkiaSharp" Version="3.116.1" />
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="3.116.1" />
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="3.116.1" />
|
||||
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.1" />
|
||||
</ItemGroup>
|
||||
<!-- https://learn.microsoft.com/en-us/nuget/consume-packages/central-package-management -->
|
||||
<PropertyGroup>
|
||||
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
|
||||
<Version>1.1.1.0</Version>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<!-- Avalonia packages -->
|
||||
<!-- Important: keep version in sync! -->
|
||||
<PackageVersion Include="Avalonia" Version="12.0.3" />
|
||||
<PackageVersion Include="Avalonia.AvaloniaEdit" Version="12.0.0" />
|
||||
<PackageVersion Include="Avalonia.Themes.Fluent" Version="12.0.3" />
|
||||
<PackageVersion Include="Avalonia.Fonts.Inter" Version="12.0.3" />
|
||||
<PackageVersion Include="AvaloniaUI.DiagnosticsSupport" Version="2.2.1" />
|
||||
<PackageVersion Include="Avalonia.Diagnostics" Version="11.3.16" />
|
||||
<PackageVersion Include="Avalonia.Desktop" Version="12.0.3" />
|
||||
<PackageVersion Include="Avalonia.iOS" Version="12.0.3" />
|
||||
<PackageVersion Include="Avalonia.Browser" Version="12.0.3" />
|
||||
<PackageVersion Include="Avalonia.Android" Version="12.0.3" />
|
||||
<PackageVersion Include="AvaloniaEdit.TextMate" Version="12.0.0" />
|
||||
<PackageVersion Include="Deadpikle.AvaloniaProgressRing" Version="0.11.0" />
|
||||
<PackageVersion Include="DialogHost.Avalonia" Version="0.12.2" />
|
||||
<PackageVersion Include="Jint" Version="4.5.0" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="11.0.0-preview.4.26230.115" />
|
||||
<PackageVersion Include="Microsoft.Extensions.Configuration.Json" Version="11.0.0-preview.4.26230.115" />
|
||||
<PackageVersion Include="Microsoft.Maui.Graphics" Version="10.0.11" />
|
||||
<PackageVersion Include="Microsoft.Maui.Graphics.Skia" Version="10.0.11" />
|
||||
<PackageVersion Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.23.0" />
|
||||
<PackageVersion Include="Newtonsoft.Json" Version="13.0.4" />
|
||||
<PackageVersion Include="PanAndZoom" Version="12.0.0.1" />
|
||||
<PackageVersion Include="SkiaSharp" Version="3.116.1" />
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.Linux" Version="4.147.0-preview.2.1" />
|
||||
<PackageVersion Include="SkiaSharp.NativeAssets.WebAssembly" Version="3.116.1" />
|
||||
<PackageVersion Include="Xamarin.AndroidX.Core.SplashScreen" Version="1.2.0.1" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,22 @@
|
||||
using Android.App;
|
||||
using Android.Runtime;
|
||||
using Avalonia;
|
||||
using Avalonia.Android;
|
||||
using Progrart;
|
||||
|
||||
namespace Progrart.Android
|
||||
{
|
||||
[Application]
|
||||
public class Application : AvaloniaAndroidApplication<App>
|
||||
{
|
||||
protected Application(nint javaReference, JniHandleOwnership transfer) : base(javaReference, transfer)
|
||||
{
|
||||
}
|
||||
|
||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||
{
|
||||
return base.CustomizeAppBuilder(builder)
|
||||
.WithInterFont();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,12 @@ namespace Progrart.Android;
|
||||
RoundIcon = "@drawable/app_icon",
|
||||
MainLauncher = true,
|
||||
ConfigurationChanges = ConfigChanges.Orientation | ConfigChanges.ScreenSize | ConfigChanges.UiMode)]
|
||||
public class MainActivity : AvaloniaMainActivity<App>
|
||||
//public class MainActivity : AvaloniaMainActivity<App>
|
||||
public class MainActivity : AvaloniaMainActivity//<App>
|
||||
{
|
||||
protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||
{
|
||||
return base.CustomizeAppBuilder(builder)
|
||||
.WithInterFont();
|
||||
}
|
||||
//protected override AppBuilder CustomizeAppBuilder(AppBuilder builder)
|
||||
//{
|
||||
// return base.CustomizeAppBuilder(builder)
|
||||
// .WithInterFont();
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,9 @@ internal sealed partial class Program
|
||||
App.SettingsProvider=new BrowserSettingsProvider();
|
||||
return BuildAvaloniaApp()
|
||||
.WithInterFont()
|
||||
#if DEBUG
|
||||
.WithDeveloperTools()
|
||||
#endif
|
||||
.StartBrowserAppAsync("out");
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Browser" />
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.WebAssembly" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -21,9 +21,10 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.Desktop"/><!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Include="Avalonia.Diagnostics">
|
||||
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
||||
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
||||
|
||||
<PackageReference Include="AvaloniaUI.DiagnosticsSupport" >
|
||||
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
||||
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="SkiaSharp.NativeAssets.Linux"/>
|
||||
</ItemGroup>
|
||||
|
||||
+12
-12
@@ -84,7 +84,7 @@ public partial class App : Application
|
||||
// Avoid duplicate validations from both Avalonia and the CommunityToolkit.
|
||||
// More info: https://docs.avaloniaui.net/docs/guides/development-guides/data-validation#manage-validationplugins
|
||||
isDesktop = true;
|
||||
DisableAvaloniaDataAnnotationValidation();
|
||||
//DisableAvaloniaDataAnnotationValidation();
|
||||
desktop.MainWindow = new MainWindow();
|
||||
}
|
||||
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
|
||||
@@ -95,16 +95,16 @@ public partial class App : Application
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
|
||||
private void DisableAvaloniaDataAnnotationValidation()
|
||||
{
|
||||
// Get an array of plugins to remove
|
||||
var dataValidationPluginsToRemove =
|
||||
BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();
|
||||
//private void DisableAvaloniaDataAnnotationValidation()
|
||||
//{
|
||||
// // Get an array of plugins to remove
|
||||
// var dataValidationPluginsToRemove =
|
||||
// BindingPlugins.DataValidators.OfType<DataAnnotationsValidationPlugin>().ToArray();
|
||||
|
||||
// remove each entry found
|
||||
foreach (var plugin in dataValidationPluginsToRemove)
|
||||
{
|
||||
BindingPlugins.DataValidators.Remove(plugin);
|
||||
}
|
||||
}
|
||||
// // remove each entry found
|
||||
// foreach (var plugin in dataValidationPluginsToRemove)
|
||||
// {
|
||||
// BindingPlugins.DataValidators.Remove(plugin);
|
||||
// }
|
||||
//}
|
||||
}
|
||||
@@ -202,7 +202,6 @@ public partial class ProgrartEditorPage : UserControl, ITabPage, IEditorPage
|
||||
{
|
||||
if (LayoutButtonV.IsChecked == true)
|
||||
{
|
||||
|
||||
direction = LayoutDirection.Vertical;
|
||||
ApplyLayout();
|
||||
}
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" />
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" />
|
||||
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
|
||||
<PackageReference Include="Avalonia.Diagnostics">
|
||||
<PackageReference Include="AvaloniaUI.DiagnosticsSupport">
|
||||
<IncludeAssets Condition="'$(Configuration)' != 'Debug'">None</IncludeAssets>
|
||||
<PrivateAssets Condition="'$(Configuration)' != 'Debug'">All</PrivateAssets>
|
||||
</PackageReference>
|
||||
|
||||
@@ -8,7 +8,8 @@ public partial class MainWindow : Window
|
||||
{
|
||||
InitializeComponent();
|
||||
this.ExtendClientAreaToDecorationsHint = true;
|
||||
this.ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome;
|
||||
//this.WindowDecorations= WindowDecorations.
|
||||
//this.ExtendClientAreaChromeHints = Avalonia.Platform.ExtendClientAreaChromeHints.PreferSystemChrome;
|
||||
this.Closing += MainWindow_Closing;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user