Update avalonia

This commit is contained in:
TheXamlGuy
2024-07-23 22:37:36 +01:00
parent afe2222201
commit e7d505448e
5 changed files with 33 additions and 23 deletions
@@ -20,7 +20,7 @@
<Content Include="Icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia.Desktop" Version="11.1.0-rc2" />
<PackageReference Include="Avalonia.Desktop" Version="11.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Wallet.Avalonia\Wallet.Avalonia.csproj" />
@@ -6,5 +6,6 @@
x:DataType="vm:CommentEntryCollectionViewModel"
Header="{Binding Key}"
IsExpanded="True"
IsToggleable="{Binding Count}"
ItemTemplate="{ReflectionBinding Template}"
ItemsSource="{Binding}" />
@@ -10,7 +10,7 @@
<Interaction.Behaviors>
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static NavigationViewExtension.ItemInvokedEvent}">
<NavigateAction Region="Left" Route="ItemCategoryCollection">
<Parameter Key="Transition" Value="FromRight" />
<Parameter Key="Transition" Value="Suppress" />
<Parameter Key="IsBackStackEnabled" Value="{x:True}" />
<Parameter Key="ClearBackStack" Value="[2-2]" />
</NavigateAction>
+4 -4
View File
@@ -19,22 +19,22 @@
<Content Include="Assets\Icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Condition="$(DefineConstants.Contains(ENABLE_XAML_HOT_RELOAD))" Include="Avalonia.Markup.Xaml.Loader" Version="11.1.0-rc2" />
<PackageReference Condition="$(DefineConstants.Contains(ENABLE_XAML_HOT_RELOAD))" Include="Avalonia.Markup.Xaml.Loader" Version="11.1.0" />
<PackageReference Condition="$(DefineConstants.Contains(ENABLE_XAML_HOT_RELOAD))" Include="HotAvalonia" Version="1.1.1" />
<PackageReference Include="HotAvalonia.Extensions" Version="1.1.1" PrivateAssets="All" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.0-rc2" />
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.0" />
<PackageReference Include="Avalonia.Labs.Controls" Version="11.0.10.1" />
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="FluentAvaloniaUI" Version="2.1.0-preview6" />
<PackageReference Include="System.Reactive" Version="6.0.1" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.1.0-rc2" />
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.1.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.6.24327.7" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0-preview.6.24327.4">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0-rc2" />
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="11.1.0" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Toolkit\Toolkit.Avalonia\Toolkit.Avalonia.csproj" />
+26 -17
View File
@@ -2,23 +2,29 @@
namespace Wallet;
public partial class CommentEntryCollectionViewModel(IServiceProvider provider,
IServiceFactory factory,
IMediator mediator,
IPublisher publisher,
ISubscriber subscriber,
IDisposer disposer,
IContentTemplate template,
ItemState state,
ItemEntryConfiguration<ICollection<Comment>> configuration,
string key,
ICollection<Comment> value,
bool isConcealed,
bool isRevealed,
double width) : ItemEntryCollectionViewModel<ICommentEntryViewModel, ICollection<Comment>>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width),
public partial class CommentEntryCollectionViewModel : ItemEntryCollectionViewModel<ICommentEntryViewModel, ICollection<Comment>>,
INotificationHandler<CreateEventArgs<Comment>>
{
public IContentTemplate Template { get; set; } = template;
public CommentEntryCollectionViewModel(IServiceProvider provider,
IServiceFactory factory,
IMediator mediator,
IPublisher publisher,
ISubscriber subscriber,
IDisposer disposer,
IContentTemplate template,
ItemState state,
ItemEntryConfiguration<ICollection<Comment>> configuration,
string key,
ICollection<Comment> value,
bool isConcealed,
bool isRevealed,
double width) : base(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width)
{
Template = template;
UpdateState();
}
public IContentTemplate Template { get; set; }
public Task Handle(CreateEventArgs<Comment> args)
{
@@ -31,9 +37,12 @@ public partial class CommentEntryCollectionViewModel(IServiceProvider provider,
return Task.CompletedTask;
}
protected override void OnStateChanged()
protected override void OnStateChanged() =>
UpdateState();
private void UpdateState()
{
if (State is ItemState.Write)
if (State is ItemState.Write or ItemState.New)
{
Add<CreateCommentEntryViewModel>();
}