Updated packages. Migrated Avalonia UI to 12.0.

This commit is contained in:
2026-04-15 09:52:25 -04:00
parent c747635703
commit 5f7b716d25
11 changed files with 32 additions and 21 deletions

View File

@@ -9,10 +9,10 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="ManagedBass" Version="4.0.2" /> <PackageReference Include="ManagedBass" Version="4.0.2" />
<PackageReference Include="ManagedBass.Flac" Version="4.0.2" /> <PackageReference Include="ManagedBass.Flac" Version="4.0.2" />
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.5" /> <PackageReference Include="Microsoft.EntityFrameworkCore" Version="10.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.5" /> <PackageReference Include="Microsoft.Extensions.Caching.Abstractions" Version="10.0.6" />
<PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.5" /> <PackageReference Include="Microsoft.Extensions.Caching.Memory" Version="10.0.6" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.5" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.6" />
<PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" /> <PackageReference Include="System.Text.RegularExpressions" Version="4.3.1" />
<PackageReference Include="TagLibSharp" Version="2.3.0" /> <PackageReference Include="TagLibSharp" Version="2.3.0" />
</ItemGroup> </ItemGroup>

View File

@@ -16,7 +16,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.3.0" /> <PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.4.0" />
<PackageReference Include="NSubstitute" Version="5.3.0" /> <PackageReference Include="NSubstitute" Version="5.3.0" />
<PackageReference Include="Shouldly" Version="4.3.0" /> <PackageReference Include="Shouldly" Version="4.3.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="3.1.5"> <PackageReference Include="xunit.runner.visualstudio" Version="3.1.5">

View File

@@ -10,7 +10,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.3.13" /> <PackageReference Include="Avalonia.Desktop" Version="12.0.1" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -4,6 +4,7 @@
xmlns:control="clr-namespace:Harmonia.UI.Controls" xmlns:control="clr-namespace:Harmonia.UI.Controls"
xmlns:converters="clr-namespace:Harmonia.UI.Converters" xmlns:converters="clr-namespace:Harmonia.UI.Converters"
xmlns:semi="https://irihi.tech/semi" xmlns:semi="https://irihi.tech/semi"
xmlns:ia="using:Avalonia.Xaml.Interactions.Animated"
x:Class="Harmonia.UI.App" x:Class="Harmonia.UI.App"
RequestedThemeVariant="Default"> RequestedThemeVariant="Default">
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. --> <!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->

View File

@@ -45,7 +45,7 @@ public partial class App : Application
{ {
// Line below is needed to remove Avalonia data validation. // Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT // Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0); //BindingPlugins.DataValidators.RemoveAt(0);
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{ {

View File

@@ -90,7 +90,9 @@ public class AnimatedMenuFlyout : MenuFlyout
//Android (and iOS?) //Android (and iOS?)
else if (Application.Current?.ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform) else if (Application.Current?.ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
{ {
IRenderRoot? visualRoot = singleViewPlatform.MainView?.GetVisualRoot(); //IRenderRoot? visualRoot = singleViewPlatform.MainView?.GetVisualRoot();
Visual? visualRoot = singleViewPlatform.MainView?.GetPresentationSource()?.RootVisual;
if (visualRoot is TopLevel topLevel) if (visualRoot is TopLevel topLevel)
{ {

View File

@@ -11,15 +11,16 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="Avalonia" Version="11.3.13" /> <PackageReference Include="Avalonia" Version="12.0.1" />
<PackageReference Include="Avalonia.Themes.Fluent" Version="11.3.13" /> <PackageReference Include="Avalonia.Themes.Fluent" Version="12.0.1" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.3.13" /> <PackageReference Include="Avalonia.Fonts.Inter" Version="12.0.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" /> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.4.2" />
<!--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 Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.13" /> <PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.3.14" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.5" /> <PackageReference Include="Egolds.Xaml.Behaviors.Interactions.Animated" Version="11.3.3" />
<PackageReference Include="Semi.Avalonia" Version="11.3.7.3" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="10.0.6" />
<PackageReference Include="Semi.Avalonia" Version="12.0.0" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@@ -24,7 +24,9 @@ public abstract class PlatformServiceLocator<T> : IPlatformServiceLocator<T>
if (singleViewPlatform.MainView == null) if (singleViewPlatform.MainView == null)
return default; return default;
IRenderRoot? visualRoot = singleViewPlatform.MainView.GetVisualRoot(); //IRenderRoot? visualRoot = singleViewPlatform.MainView.GetVisualRoot();
Visual? visualRoot = singleViewPlatform.MainView?.GetPresentationSource()?.RootVisual;
if (visualRoot is TopLevel topLevel) if (visualRoot is TopLevel topLevel)
{ {

View File

@@ -450,7 +450,7 @@ public class PlaylistViewModel : ViewModelBase
if (clipboard == null) if (clipboard == null)
return []; return [];
string? clipboardText = await clipboard.GetTextAsync(); string? clipboardText = await clipboard.TryGetTextAsync();
if (string.IsNullOrWhiteSpace(clipboardText)) if (string.IsNullOrWhiteSpace(clipboardText))
return []; return [];

View File

@@ -5,6 +5,7 @@
xmlns:vm="clr-namespace:Harmonia.UI.ViewModels" xmlns:vm="clr-namespace:Harmonia.UI.ViewModels"
xmlns:converter="clr-namespace:Harmonia.UI.Converters" xmlns:converter="clr-namespace:Harmonia.UI.Converters"
xmlns:controls="clr-namespace:Harmonia.UI.Controls" xmlns:controls="clr-namespace:Harmonia.UI.Controls"
xmlns:ia="using:Avalonia.Xaml.Interactions.Animated"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
DataContext="{x:Static vm:ViewModelLocator.PlaylistViewModel}" DataContext="{x:Static vm:ViewModelLocator.PlaylistViewModel}"
x:Class="Harmonia.UI.Views.PlaylistView" x:Class="Harmonia.UI.Views.PlaylistView"
@@ -155,11 +156,15 @@
<!--<ListBox.Styles> <!--<ListBox.Styles>
<Style Selector="ListBoxItem:nth-child(odd):not(:pointerover):not(:selected)"> <Style Selector="ListBoxItem:nth-child(odd):not(:pointerover):not(:selected)">
<Setter Property="Background" Value="#00000000"/> <Setter Property="Background" Value="#00000000"/>
--><!-- Light Gray --><!-- -->
<!-- Light Gray -->
<!--
</Style> </Style>
<Style Selector="ListBoxItem:nth-child(even):not(:pointerover):not(:selected)"> <Style Selector="ListBoxItem:nth-child(even):not(:pointerover):not(:selected)">
<Setter Property="Background" Value="#22AAAAAA"/> <Setter Property="Background" Value="#22AAAAAA"/>
--><!-- Slightly Darker Gray --><!-- -->
<!-- Slightly Darker Gray -->
<!--
</Style> </Style>
</ListBox.Styles>--> </ListBox.Styles>-->
<ListBox.ItemTemplate> <ListBox.ItemTemplate>

View File

@@ -243,7 +243,7 @@ public partial class PlaylistView : UserControl
// AddHandler(DragDrop.DragLeaveEvent, DragLeave); // AddHandler(DragDrop.DragLeaveEvent, DragLeave);
//} //}
private async void StartDrag(object? sender, Action<DataObject> factory, PointerPressedEventArgs e, DragDropEffects effects) private async void StartDrag(object? sender, Action<DataTransfer> factory, PointerPressedEventArgs e, DragDropEffects effects)
{ {
if (e.GetCurrentPoint((Visual)sender!).Properties.IsLeftButtonPressed == false) if (e.GetCurrentPoint((Visual)sender!).Properties.IsLeftButtonPressed == false)
{ {
@@ -253,10 +253,10 @@ public partial class PlaylistView : UserControl
return; return;
} }
var dragData = new DataObject(); var dragData = new DataTransfer();
factory(dragData); factory(dragData);
var result = await DragDrop.DoDragDrop(e, dragData, effects); var result = await DragDrop.DoDragDropAsync(e, dragData, effects);
} }
private void DragOver(object? sender, DragEventArgs e) private void DragOver(object? sender, DragEventArgs e)