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