Disable selection animation for now
This commit is contained in:
@@ -5,6 +5,8 @@ namespace Wallet.Avalonia;
|
||||
public partial class AllNavigationView :
|
||||
NavigationViewItem
|
||||
{
|
||||
public AllNavigationView() =>
|
||||
public AllNavigationView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,7 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Toolkit.Avalonia;
|
||||
using Toolkit.Foundation;
|
||||
using FluentAvalonia.Core;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
@@ -20,6 +21,8 @@ public partial class App : Application
|
||||
public override void Initialize()
|
||||
{
|
||||
this.EnableHotReload();
|
||||
FAUISettings.SetAnimationsEnabledAtAppLevel(false);
|
||||
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,14 +2,23 @@
|
||||
x:Class="Wallet.Avalonia.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:MainViewModel">
|
||||
<NavigationView
|
||||
FooterMenuItemsSource="{Binding Footer}"
|
||||
IsSettingsVisible="False"
|
||||
MenuItemTemplate="{Binding Template}"
|
||||
MenuItemsSource="{Binding SelectedItem, Mode=TwoWay}"
|
||||
MenuItemsSource="{Binding SelectedItem}"
|
||||
SelectionFollowsFocus="True">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{ReflectionBinding SelectedItem.IsOpened}" Value="True">
|
||||
<InvokeNavigationViewItemAction />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{ReflectionBinding SelectedItem.IsSelected}" Value="True">
|
||||
<InvokeNavigationViewItemAction />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
<NavigationView.PaneCustomContent>
|
||||
<Grid RowDefinitions="*,Auto">
|
||||
<ListBox
|
||||
@@ -19,6 +28,9 @@
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem}">
|
||||
<ListBox.Resources>
|
||||
<StaticResource x:Key="ListViewItemBackgroundSelected" ResourceKey="SubtleFillColorTransparentBrush" />
|
||||
</ListBox.Resources>
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
<PackageReference Include="Avalonia.Fonts.Inter" Version="11.1.0-rc1" />
|
||||
<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-preview5" />
|
||||
<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-rc1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.5.24306.7" />
|
||||
|
||||
@@ -14,7 +14,7 @@ public class CreateWalletHandler(IWalletFactory componentFactory,
|
||||
{
|
||||
if (args.Sender is Wallet <(string, string)> Wallet)
|
||||
{
|
||||
if (Wallet.Sender is (string name, string password) &&
|
||||
if (Wallet.Value is (string name, string password) &&
|
||||
name is { Length: > 0 } &&
|
||||
password is { Length: > 0 })
|
||||
{
|
||||
|
||||
@@ -34,11 +34,17 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(IsActivated = false);
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsActivated = false;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(IsActivated = true);
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsActivated = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
[Notification(typeof(NotifyEventArgs<Item<int>>), nameof(Value))]
|
||||
@@ -58,14 +64,20 @@ public abstract partial class FilterNavigationViewModel<TWalletNavigation>(IServ
|
||||
IWalletNavigationViewModel
|
||||
{
|
||||
[ObservableProperty]
|
||||
private bool activated;
|
||||
private bool isActivated;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isSelected;
|
||||
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = false);
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(Activated = true);
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsActivated = false;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsActivated = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@ public class OpenWalletHandler(IConfigurationDescriptor<WalletConfiguration> des
|
||||
{
|
||||
if (args.Sender is Wallet<string> Wallet &&
|
||||
descriptor.Name is { Length: > 0 } name &&
|
||||
Wallet.Sender is { Length: > 0 } password)
|
||||
Wallet.Value is { Length: > 0 } password)
|
||||
{
|
||||
WalletConfiguration configuration = descriptor.Value;
|
||||
if (configuration.Key?.Split(':') is { Length: >= 2 } keyPart)
|
||||
|
||||
@@ -14,7 +14,7 @@ public class QueryWalletHandler(IDbContextFactory<WalletContext> dbContextFactor
|
||||
List<(Guid Id, string? Name, string Category, bool Favourite, bool Archived)> items = [];
|
||||
if (args.Sender is Wallet<(string, string)> Wallet)
|
||||
{
|
||||
(string filter, string text) = Wallet.Sender;
|
||||
(string filter, string text) = Wallet.Value;
|
||||
|
||||
ExpressionStarter<ItemEntry> predicate =
|
||||
PredicateBuilder.New<ItemEntry>(true);
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
namespace Wallet;
|
||||
|
||||
public record Wallet<TSender>(TSender Sender);
|
||||
public record Wallet<TValue>(TValue Value);
|
||||
|
||||
public record Wallet;
|
||||
@@ -9,7 +9,7 @@ public class WalletActivatedHandler(IWalletHostCollection Wallets,
|
||||
{
|
||||
public Task Handle(ActivatedEventArgs<Wallet<IComponentHost>> args)
|
||||
{
|
||||
if (args.Sender is Wallet<IComponentHost> wallet && wallet.Sender is IComponentHost host)
|
||||
if (args.Sender is Wallet<IComponentHost> wallet && wallet.Value is IComponentHost host)
|
||||
{
|
||||
List<IComponentHost> sortedWallets = [.. Wallets, host];
|
||||
sortedWallets = [.. sortedWallets.OrderBy(x => x.Services.GetRequiredService<IConfigurationDescriptor<WalletConfiguration>>() is
|
||||
|
||||
@@ -65,9 +65,15 @@ public partial class WalletNavigationViewModel :
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(IsActivated = false);
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args) =>
|
||||
Task.FromResult(IsActivated = true);
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsActivated = false;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
public Task Handle(ActivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsActivated = true;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user