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