Mass rename project for rebranding
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.AddItemNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Header="Add item"
|
||||
IsClickEnabled="True" />
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class AddItemNavigationView :
|
||||
SettingsExpander
|
||||
{
|
||||
public AddItemNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Wallet.Avalonia.AllNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:AllNavigationViewModel"
|
||||
Content="All"
|
||||
IsSelected="{Binding Selected}">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Wallet">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</NavigationViewItem>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class AllNavigationView : NavigationViewItem
|
||||
{
|
||||
public AllNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Application
|
||||
x:Class="Wallet.Avalonia.App"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls">
|
||||
<Application.Styles>
|
||||
<ThemeResources PreferSystemTheme="True" PreferUserAccentColor="True" />
|
||||
</Application.Styles>
|
||||
</Application>
|
||||
@@ -0,0 +1,215 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
using Wallet.Data;
|
||||
using HotAvalonia;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.DependencyInjection.Extensions;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Toolkit.Avalonia;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public override void Initialize()
|
||||
{
|
||||
this.EnableHotReload();
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override async void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
IHost? host = DefaultHostBuilder.Create()
|
||||
.AddConfiguration<WalletConfiguration>("Wallet:*")
|
||||
.AddConfiguration<ItemConfiguration>("Item:*")
|
||||
.AddConfiguration("Item:Bank Account", ItemConfiguration.BankAccount)
|
||||
.AddConfiguration("Item:Credit Card", ItemConfiguration.CreditCard)
|
||||
.AddConfiguration("Item:Document", ItemConfiguration.Document)
|
||||
.AddConfiguration("Item:Driving Licence", ItemConfiguration.DrivingLicence)
|
||||
.AddConfiguration("Item:Identity", ItemConfiguration.Identity)
|
||||
.AddConfiguration("Item:Login", ItemConfiguration.Login)
|
||||
.AddConfiguration("Item:Note", ItemConfiguration.Note)
|
||||
.AddConfiguration("Item:Password", ItemConfiguration.Password)
|
||||
.AddConfiguration("Item:Passport", ItemConfiguration.Passport)
|
||||
.AddConfiguration("Item:Api Credentials", ItemConfiguration.ApiCredentials)
|
||||
.AddConfiguration("Item:Software License", ItemConfiguration.SoftwareLicense)
|
||||
.AddConfiguration("Item:Crypto", ItemConfiguration.CryptoWallet)
|
||||
.AddConfiguration("Item:Database", ItemConfiguration.Database)
|
||||
.AddConfiguration("Item:Membership", ItemConfiguration.Membership)
|
||||
.AddConfiguration("Item:Insurance Documents", ItemConfiguration.InsuranceDocuments)
|
||||
.AddConfiguration("Item:Utility", ItemConfiguration.Utility)
|
||||
.AddConfiguration("Item:Server", ItemConfiguration.Server)
|
||||
.AddConfiguration("Item:Education Record", ItemConfiguration.EducationRecord)
|
||||
.AddConfiguration("Item:Travel Documents", ItemConfiguration.TravelDocuments)
|
||||
.AddConfiguration("Item:Concert Ticket", ItemConfiguration.ConcertTicket)
|
||||
.ConfigureServices((context, services) =>
|
||||
{
|
||||
services.AddAvalonia();
|
||||
services.AddHandler<AppHandler>();
|
||||
|
||||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime)
|
||||
{
|
||||
services.AddTemplate<MainWindowViewModel, MainWindow>("MainWindow");
|
||||
}
|
||||
|
||||
services.AddHandler<WalletActivatedHandler>();
|
||||
|
||||
services.AddTransient<IWalletComponent>(provider => Component.Create<WalletComponent>(provider, args =>
|
||||
{
|
||||
args.AddServices(services =>
|
||||
{
|
||||
services.AddTransient<IComparer<Item<(Guid, string)>>>(provider => Comparer<Item<(Guid, string)>>.Create((x, z) =>
|
||||
StringComparer.CurrentCultureIgnoreCase.Compare(x.Value.Item2, z.Value.Item2)));
|
||||
|
||||
services.AddCache<Item<(Guid, string)>>();
|
||||
|
||||
services.AddTransient(_ =>
|
||||
provider.GetServices<IConfigurationDescriptor<ItemConfiguration>>());
|
||||
|
||||
services.AddTransient<IKeyGenerator, KeyGenerator>();
|
||||
services.AddTransient<IEncryptor, AesEncryptor>();
|
||||
services.AddTransient<IDecryptor, AesDecryptor>();
|
||||
|
||||
services.AddTransient<IPasswordHasher, PasswordHasher>();
|
||||
services.AddTransient<IKeyDeriver, KeyDeriver>();
|
||||
|
||||
services.AddTransient<ISecurityKeyFactory, SecurityKeyFactory>();
|
||||
services.AddTransient<IWalletStorageFactory, WalletStorageFactory>();
|
||||
|
||||
services.AddTransient<IItemConfigurationCollection, ItemConfigurationCollection>(provider =>
|
||||
{
|
||||
IEnumerable<IConfigurationDescriptor<ItemConfiguration>> items =
|
||||
provider.GetServices<IConfigurationDescriptor<ItemConfiguration>>() ??
|
||||
Enumerable.Empty<IConfigurationDescriptor<ItemConfiguration>>();
|
||||
|
||||
return new ItemConfigurationCollection(items.ToDictionary(x => x.Name, x => (Func<ItemConfiguration>)(() => x.Value)));
|
||||
});
|
||||
|
||||
services.TryAddSingleton<IDecoratorService<SecurityKey>, DecoratorService<SecurityKey>>();
|
||||
services.TryAddSingleton<IDecoratorService<WalletConnection>, DecoratorService<WalletConnection>>();
|
||||
|
||||
services.AddDbContextFactory<WalletContext>((provider, args) =>
|
||||
{
|
||||
if (provider.GetRequiredService<IDecoratorService<WalletConnection>>()
|
||||
is IDecoratorService<WalletConnection> connection)
|
||||
{
|
||||
args.UseSqlite($"{connection.Service}");
|
||||
}
|
||||
});
|
||||
|
||||
services.AddHandler<QueryWalletHandler>();
|
||||
services.AddHandler<RequestItemHandler>();
|
||||
services.AddHandler<CreateItemHandler>();
|
||||
services.AddHandler<UpdateItemHander>();
|
||||
services.AddHandler<UpdateItemStateHandler>();
|
||||
|
||||
services.AddHandler<OpenWalletHandler>();
|
||||
|
||||
services.AddTemplate<WalletNavigationViewModel, WalletNavigationView>();
|
||||
services.AddTemplate<AllNavigationViewModel, AllNavigationView>();
|
||||
services.AddTemplate<StarredNavigationViewModel, StarredNavigationView>();
|
||||
services.AddTemplate<CategoriesNavigationViewModel, CategoriesNavigationView>();
|
||||
services.AddTemplate<ArchiveNavigationViewModel, ArchiveNavigationView>();
|
||||
|
||||
services.AddTemplate<OpenWalletViewModel, OpenWalletView>("OpenWallet");
|
||||
|
||||
services.AddScoped<WalletViewModelConfiguration>();
|
||||
|
||||
services.AddTemplate<WalletViewModel, WalletView>("Wallet");
|
||||
services.AddTemplate<ItemCollectionViewModel, ItemCollectionView>("ContentItemCollection");
|
||||
|
||||
services.AddHandler<SynchronizeItemViewModelHandler>();
|
||||
|
||||
services.AddTemplate<WalletHeaderViewModel, WalletHeaderView>("WalletHeader");
|
||||
services.AddTemplate<BackActionViewModel, BackActionView>();
|
||||
services.AddTemplate<CreateItemActionViewModel, CreateItemActionView>();
|
||||
services.AddTemplate<SearchWalletActionViewModel, SearchWalletActionView>();
|
||||
|
||||
services.AddTemplate<ItemCategoryCollectionViewModel, ItemCategoryCollectionView>("ItemCategoryCollection");
|
||||
services.AddTemplate<ItemCategoryNavigationViewModel, ItemCategoryNavigationView>();
|
||||
|
||||
services.AddHandler<SynchronizeItemCategoryViewModelHandler>();
|
||||
|
||||
services.AddScoped<IDecoratorService<Item<(Guid, string)>>, DecoratorService<Item<(Guid, string)>>>();
|
||||
|
||||
services.AddTemplate<AddItemNavigationViewModel, AddItemNavigationView>();
|
||||
|
||||
services.AddTemplate<ItemNavigationViewModel, ItemNavigationView>();
|
||||
services.AddTemplate<EmptyItemCollectionViewModel, EmptyItemCollectionView>("EmptyItemCollection");
|
||||
|
||||
services.AddScoped<IDecoratorService<ItemConfiguration>, DecoratorService<ItemConfiguration>>();
|
||||
|
||||
services.AddTemplate<ItemViewModel, ItemView>("Item");
|
||||
services.AddTemplate<ItemHeaderViewModel, ItemHeaderView>();
|
||||
services.AddTemplate<ItemContentViewModel, ItemContentView>();
|
||||
|
||||
services.AddHandler<SynchronizeItemContentViewModelHandler>();
|
||||
services.AddHandler<SynchronizeItemContentFromCategoryViewModelHandler>();
|
||||
|
||||
services.AddTemplate<ItemSectionViewModel, ItemSectionView>();
|
||||
|
||||
services.AddTemplate<TextEntryViewModel, TextEntryView>();
|
||||
services.AddTemplate<MultilineTextEntryViewModel, MultilineTextEntryView>();
|
||||
services.AddTemplate<PasswordEntryViewModel, PasswordEntryView>();
|
||||
services.AddTemplate<MaskedTextEntryViewModel, MaskedTextEntryView>();
|
||||
services.AddTemplate<DropdownEntryViewModel, DropdownEntryView>();
|
||||
services.AddTemplate<DateEntryViewModel, DateEntryView>();
|
||||
|
||||
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
|
||||
|
||||
services.AddTemplate<FavouriteItemActionViewModel, FavouriteItemActionView>();
|
||||
services.AddTemplate<ConfirmItemActionViewModel, ConfirmItemActionView>();
|
||||
services.AddTemplate<DismissItemActionViewModel, DismissItemActionView>();
|
||||
services.AddTemplate<ArchiveItemActionViewModel, ArchiveItemActionView>();
|
||||
services.AddTemplate<UnarchiveItemActionViewModel, UnarchiveItemActionView>();
|
||||
services.AddTemplate<EditItemActionViewModel, EditItemActionView>();
|
||||
services.AddTemplate<DeleteItemActionViewModel, DeleteItemActionView>();
|
||||
|
||||
services.AddHandler<ConfirmUpdateItemHandler>(nameof(ItemState.Write));
|
||||
services.AddHandler<ConfirmCreateItemHandler>(nameof(ItemState.New));
|
||||
|
||||
services.AddHandler<ArchiveItemHandler>();
|
||||
services.AddHandler<UnarchiveItemHandler>();
|
||||
services.AddHandler<FavouriteItemHandler>();
|
||||
services.AddHandler<UnfavouriteItemHandler>();
|
||||
|
||||
services.AddHandler<TextEntryViewModelHandler>(nameof(TextEntryConfiguration));
|
||||
services.AddHandler<MultilineTextEntryViewModelHandler>(nameof(MultilineTextEntryConfiguration));
|
||||
services.AddHandler<PasswordEntryViewModelHandler>(nameof(PasswordEntryConfiguration));
|
||||
services.AddHandler<MaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
|
||||
services.AddHandler<DropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
|
||||
services.AddHandler<DateEntryViewModelHandler>(nameof(DateEntryConfiguration));
|
||||
|
||||
services.AddHandler<ItemCreatedHandler>(ServiceLifetime.Singleton);
|
||||
services.AddHandler<ItemModifiedHandler>(ServiceLifetime.Singleton);
|
||||
});
|
||||
})!);
|
||||
|
||||
services.AddTransient<IWalletFactory, WalletFactory>();
|
||||
services.AddHandler<CreateWalletHandler>();
|
||||
|
||||
services.AddSingleton<IWalletHostCollection, WalletHostCollection>();
|
||||
services.AddInitializer<WalletInitializer>();
|
||||
|
||||
services.AddTemplate<MainViewModel, MainView>("Main");
|
||||
services.AddHandler<SynchronizeMainViewModelHandler>();
|
||||
|
||||
services.AddTransient<FooterViewModel>();
|
||||
|
||||
services.AddTemplate<ManageNavigationViewModel, ManageNavigationView>();
|
||||
services.AddTemplate<ManageViewModel, ManageView>("Manage");
|
||||
|
||||
services.AddTemplate<CreateWalletNavigationViewModel, CreateWalletNavigationView>();
|
||||
services.AddTemplate<CreateWalletViewModel, CreateWalletView>("CreateWallet");
|
||||
})
|
||||
.Build();
|
||||
|
||||
await host.RunAsync();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using System.Threading.Tasks;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public class AppHandler(IPublisher publisher) :
|
||||
INotificationHandler<StartedEventArgs>
|
||||
{
|
||||
public Task Handle(StartedEventArgs args)
|
||||
{
|
||||
if (Application.Current is Application application)
|
||||
{
|
||||
if (application.ApplicationLifetime is IApplicationLifetime lifetime)
|
||||
{
|
||||
publisher.Publish(new NavigateEventArgs(lifetime is IClassicDesktopStyleApplicationLifetime ? "MainWindow" : "Main",
|
||||
lifetime is IClassicDesktopStyleApplicationLifetime ? typeof(IClassicDesktopStyleApplicationLifetime) :
|
||||
typeof(ISingleViewApplicationLifetime)));
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ArchiveItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ArchiveItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
HotKey="Delete"
|
||||
ToolTip.Tip="Archive">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ArchiveItemActionView : UserControl
|
||||
{
|
||||
public ArchiveItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Wallet.Avalonia.ArchiveNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ArchiveNavigationViewModel"
|
||||
Content="Archive"
|
||||
IsSelected="{Binding Selected, Mode=TwoWay}">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Wallet">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</NavigationViewItem>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ArchiveNavigationView : NavigationViewItem
|
||||
{
|
||||
public ArchiveNavigationView() => InitializeComponent();
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 172 KiB |
@@ -0,0 +1,42 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.BackActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<x:Double x:Key="ButtonWidth">40</x:Double>
|
||||
<x:Double x:Key="ButtonHeight">36</x:Double>
|
||||
<SolidColorBrush x:Key="ButtonBackground" Color="{DynamicResource SubtleFillColorTransparent}" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="{DynamicResource SubtleFillColorSecondary}" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="{DynamicResource SubtleFillColorTertiary}" />
|
||||
<Thickness x:Key="ButtonBorderThemeThickness">0</Thickness>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="IconForegroundBrush" Color="#AB000000" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="IconForegroundBrush" Color="#ABFFFFFF" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Back">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateBackAction Region="Left" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class BackActionView : UserControl
|
||||
{
|
||||
public BackActionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Wallet.Avalonia.CategoriesNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="Categories" />
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CategoriesNavigationView : NavigationViewItem
|
||||
{
|
||||
public CategoriesNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ConfirmItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ConfirmItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Save">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ConfirmItemActionView : UserControl
|
||||
{
|
||||
public ConfirmItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.CreateItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:CreateItemActionViewModel">
|
||||
<Button
|
||||
Height="32"
|
||||
MinWidth="144"
|
||||
HorizontalContentAlignment="Center"
|
||||
Classes="accent"
|
||||
CornerRadius="16"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
ToolTip.Tip="New Item">
|
||||
<Grid ColumnDefinitions="Auto,8,*">
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="-6,3,0,0"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
Grid.Column="2"
|
||||
Margin="0,2,0,0"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="New Item" />
|
||||
</Grid>
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateAction Region="Left" Route="ItemCategoryCollection">
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<Parameter Key="FromCategory" Value="{x:True}" />
|
||||
<Parameter Key="State" Value="{x:Static vm:ItemState.New}" />
|
||||
</NavigateAction>
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CreateItemActionView : UserControl
|
||||
{
|
||||
public CreateItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.CreateWalletNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Description="Keep organized by separating your things into Wallets."
|
||||
Header="Create a new vault">
|
||||
<SettingsExpander.Footer>
|
||||
<Button MinWidth="132" Content="Create Wallet">
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateAction Region="self" Route="CreateWallet" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Button>
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CreateWalletNavigationView : SettingsExpander
|
||||
{
|
||||
public CreateWalletNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<ContentDialog
|
||||
x:Class="Wallet.Avalonia.CreateWalletView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
Title="Create Wallet"
|
||||
x:DataType="vm:CreateWalletViewModel"
|
||||
CloseButtonText="Cancel"
|
||||
PrimaryButtonText="Create">
|
||||
<StackPanel Width="400">
|
||||
<TextBox
|
||||
Margin="0,0,0,18"
|
||||
Text="{Binding Name}"
|
||||
Watermark="Enter Wallet name" />
|
||||
<TextBox
|
||||
Margin="0,0,0,18"
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="●"
|
||||
Text="{Binding Password}"
|
||||
Watermark="Enter password" />
|
||||
<TextBox
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="●"
|
||||
Watermark="Confirm password" />
|
||||
</StackPanel>
|
||||
</ContentDialog>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CreateWalletView : ContentDialog
|
||||
{
|
||||
public CreateWalletView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.DateEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:DateEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<DatePicker SelectedDate="{Binding Value}" />
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class DateEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public DateEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.DeleteItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:DeleteItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Delete">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia
|
||||
{
|
||||
public partial class DeleteItemActionView : UserControl
|
||||
{
|
||||
public DeleteItemActionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.DismissItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:DismissItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Cancel">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class DismissItemActionView : UserControl
|
||||
{
|
||||
public DismissItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.DropdownEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:DropdownEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<Grid>
|
||||
<ComboBox
|
||||
DisplayMemberBinding="{ReflectionBinding Value}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem}"
|
||||
SelectedValue="{Binding Value}"
|
||||
SelectedValueBinding="{ReflectionBinding Value}">
|
||||
<ComboBox.Styles>
|
||||
<Style Selector="ComboBox.Write">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="ComboBox.Read">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
</ComboBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</ComboBox>
|
||||
<TextBox Text="{Binding Value}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</Grid>
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class DropdownEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public DropdownEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.EditItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:EditItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Edit">
|
||||
<TextBlock
|
||||
Margin="0,3,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class EditItemActionView : UserControl
|
||||
{
|
||||
public EditItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.EmptyItemCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:EmptyItemCollectionViewModel">
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<TextBlock
|
||||
Text="Nothing to see here"
|
||||
TextAlignment="Center"
|
||||
Theme="{DynamicResource BodyStrongTextBlockStyle}" />
|
||||
<HyperlinkButton Content="Let's start securing your items">
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Click">
|
||||
<NavigateAction Region="Left" Route="ItemCategoryCollection">
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<Parameter Key="State" Value="{x:Static vm:ItemState.Write}" />
|
||||
</NavigateAction>
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</HyperlinkButton>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class EmptyItemCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public EmptyItemCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.FavouriteItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:FavouriteItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
ToolTip.Tip="Edit">
|
||||
<Grid>
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
IsVisible="{Binding !Value}"
|
||||
Text="" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
IsVisible="{Binding Value}"
|
||||
Text="" />
|
||||
</Grid>
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class FavouriteItemActionView : UserControl
|
||||
{
|
||||
public FavouriteItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemCategoryCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemCategoryCollectionViewModel">
|
||||
<ListBox
|
||||
Margin="2,-1,0,0"
|
||||
AutoScrollToSelectedItem="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
|
||||
SelectionMode="Single">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="IsSelected" Value="{ReflectionBinding Selected, Mode=TwoWay}" />
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
</ListBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemCategoryCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemCategoryCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<ListBoxItem
|
||||
x:Class="Wallet.Avalonia.ItemCategoryNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemCategoryNavigationViewModel"
|
||||
ListBoxExtension.IsItemInvokedEnabled="True">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}">
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
</AttachedEventTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
<Grid Background="Transparent" ColumnDefinitions="Auto,*">
|
||||
<PersonPicture
|
||||
Grid.Column="0"
|
||||
Height="34"
|
||||
DisplayName="{Binding Name}" />
|
||||
<StackPanel Grid.Column="1" Margin="12,12,6,12">
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemCategoryNavigationView : ListBoxItem
|
||||
{
|
||||
public ItemCategoryNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemCollectionViewModel">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition
|
||||
LeftOperand="{Binding Count}"
|
||||
Operator="LessThanOrEqual"
|
||||
RightOperand="0" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="{Binding Named, StringFormat='{}{0}:Content'}" Route="EmptyItemCollection" />
|
||||
</ConditionAction>
|
||||
</AttachedBehaviour>
|
||||
<DataTriggerBehavior
|
||||
Binding="{Binding Count}"
|
||||
ComparisonCondition="LessThanOrEqual"
|
||||
Value="0">
|
||||
<NavigateAction Region="{Binding Named, StringFormat='{}{0}:Content'}" Route="EmptyItemCollection" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
<ListBox
|
||||
x:Name="foo"
|
||||
Margin="2,-1,0,0"
|
||||
AutoScrollToSelectedItem="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem}"
|
||||
SelectionMode="Single" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,18 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemCollectionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
foo.SelectionChanged += Foo_SelectionChanged;
|
||||
}
|
||||
|
||||
private void Foo_SelectionChanged(object? sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemCommandHeaderView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemCommandHeaderViewModel">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<x:Double x:Key="ButtonWidth">40</x:Double>
|
||||
<x:Double x:Key="ButtonHeight">36</x:Double>
|
||||
<SolidColorBrush x:Key="ButtonBackground" Color="{DynamicResource SubtleFillColorTransparent}" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPointerOver" Color="{DynamicResource SubtleFillColorSecondary}" />
|
||||
<SolidColorBrush x:Key="ButtonBackgroundPressed" Color="{DynamicResource SubtleFillColorTertiary}" />
|
||||
<Thickness x:Key="ButtonBorderThemeThickness">0</Thickness>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<SolidColorBrush x:Key="IconForegroundBrush" Color="#AB000000" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<SolidColorBrush x:Key="IconForegroundBrush" Color="#ABFFFFFF" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<ItemsControl
|
||||
HorizontalAlignment="Right"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" Spacing="4" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemCommandHeaderView : UserControl
|
||||
{
|
||||
public ItemCommandHeaderView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemContentView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemContentViewModel">
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemContentView : UserControl
|
||||
{
|
||||
public ItemContentView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemHeaderView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemHeaderViewModel">
|
||||
<StackPanel Grid.Column="1" Spacing="12">
|
||||
<PersonPicture
|
||||
Width="144"
|
||||
Height="144"
|
||||
DisplayName="{Binding Value, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBox
|
||||
MaxWidth="360"
|
||||
Text="{Binding Value}"
|
||||
TextAlignment="Center"
|
||||
Watermark="Enter name">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MinWidth" Value="264" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemHeaderView : UserControl
|
||||
{
|
||||
public ItemHeaderView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
<ListBoxItem
|
||||
x:Class="Wallet.Avalonia.ItemNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemNavigationViewModel"
|
||||
ListBoxExtension.IsItemInvokedEnabled="True">
|
||||
<ListBoxItem.Resources>
|
||||
<SolidColorBrush x:Key="StarredIconForegroundBrush" Color="#FFEDB120" />
|
||||
</ListBoxItem.Resources>
|
||||
<Interaction.Behaviors>
|
||||
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static ListBoxExtension.ItemInvokedEvent}">
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self">
|
||||
<Parameter Key="FromCategory" Value="{x:False}" />
|
||||
<Parameter Key="State" Value="{x:Static vm:ItemState.Read}" />
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
<Parameter Key="Favourite" Value="{Binding Favourite}" />
|
||||
<Parameter Key="Archived" Value="{Binding Archived}" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:False}" />
|
||||
</NavigateAction>
|
||||
</AttachedEventTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
<Grid Background="Transparent" ColumnDefinitions="Auto,*">
|
||||
<PersonPicture
|
||||
Grid.Column="0"
|
||||
Height="34"
|
||||
DisplayName="{Binding Name}" />
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="0,0,-2,10"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource StarredIconForegroundBrush}"
|
||||
IsVisible="{Binding Favourite}"
|
||||
Text="" />
|
||||
<StackPanel Grid.Column="1" Margin="12,12,6,12">
|
||||
<TextBlock FontWeight="SemiBold" Text="{Binding Name}" />
|
||||
<TextBlock Opacity="0.7" Text="{Binding Name}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</ListBoxItem>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemNavigationView : ListBoxItem
|
||||
{
|
||||
public ItemNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemSectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemSectionViewModel">
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}" />
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemSectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemSectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ItemView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ItemViewModel">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateAction
|
||||
Region="{Binding Named, StringFormat='{}{0}:ContentHeader'}"
|
||||
Route="ItemCommandHeader"
|
||||
Scope="self" />
|
||||
</AttachedBehaviour>
|
||||
<DataTriggerBehavior
|
||||
Binding="{Binding State}"
|
||||
ComparisonCondition="Equal"
|
||||
Value="{x:Static vm:ItemState.Read}">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding FromCategory}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateBackAction Region="Left" />
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
<ScrollViewer Padding="12,12,12,0">
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Spacing="24" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemView : UserControl
|
||||
{
|
||||
public ItemView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.MainView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:MainViewModel">
|
||||
<NavigationView
|
||||
FooterMenuItemsSource="{Binding Footer}"
|
||||
MenuItemTemplate="{Binding Template}"
|
||||
MenuItemsSource="{Binding}"
|
||||
IsSettingsVisible="False"
|
||||
SelectedItem="{Binding SelectedItem}"
|
||||
SelectionFollowsFocus="True">
|
||||
<NavigationView.Resources>
|
||||
<CornerRadius x:Key="NavigationViewContentGridCornerRadius">0</CornerRadius>
|
||||
<Thickness x:Key="NavigationViewContentGridBorderThickness">1,0,0,0</Thickness>
|
||||
</NavigationView.Resources>
|
||||
<Frame>
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="Main">
|
||||
<NavigateAction Region="Main" Route="Wallet" />
|
||||
</NavigateRegionAction>
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</Frame>
|
||||
</NavigationView>
|
||||
</UserControl>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class MainView : UserControl
|
||||
{
|
||||
public MainView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<windowing:AppWindow
|
||||
x:Class="Wallet.Avalonia.MainWindow"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
xmlns:windowing="using:FluentAvalonia.UI.Windowing"
|
||||
x:DataType="vm:MainWindowViewModel"
|
||||
Background="Transparent"
|
||||
TransparencyLevelHint="Mica">
|
||||
<ContentControl>
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="Window">
|
||||
<NavigateAction Region="Window" Route="Main" />
|
||||
</NavigateRegionAction>
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</windowing:AppWindow>
|
||||
@@ -0,0 +1,13 @@
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class MainWindow : AppWindow
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
TitleBar.ExtendsContentIntoTitleBar = true;
|
||||
TitleBar.TitleBarHitTestType = TitleBarHitTestType.Complex;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Wallet.Avalonia.ManageNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Content="Manage Wallets">
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Tapped">
|
||||
<NavigateAction Region="Main" Route="Manage" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</NavigationViewItem>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ManageNavigationView : NavigationViewItem
|
||||
{
|
||||
public ManageNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.ManageView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:ManageViewModel">
|
||||
<ScrollViewer Padding="12" HorizontalAlignment="Stretch">
|
||||
<ItemsControl
|
||||
MaxWidth="768"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}" />
|
||||
</ScrollViewer>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ManageView : UserControl
|
||||
{
|
||||
public ManageView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.MaskedTextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:MaskedTextEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<MaskedTextBox Mask="{Binding Pattern}" Text="{Binding Value}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</MaskedTextBox>
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia
|
||||
{
|
||||
public partial class MaskedTextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public MaskedTextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.MultilineTextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:MultilineTextEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<TextBox Text="{Binding Value}" TextWrapping="Wrap">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="Height" Value="216" />
|
||||
<Setter Property="AcceptsTab" Value="True" />
|
||||
<Setter Property="AcceptsReturn" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="Height" Value="216" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class MultilineTextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public MultilineTextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.OpenWalletView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:OpenWalletViewModel">
|
||||
<StackPanel
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
Spacing="12">
|
||||
<PersonPicture
|
||||
Width="144"
|
||||
Height="144"
|
||||
Margin="0,-144,0,0"
|
||||
DisplayName="{Binding Name}" />
|
||||
<TextBlock
|
||||
Text="{Binding Name}"
|
||||
TextAlignment="Center"
|
||||
Theme="{DynamicResource SubtitleTextBlockStyle}" />
|
||||
<TextBox
|
||||
Width="360"
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="●"
|
||||
Text="{Binding Password}">
|
||||
<Interaction.Behaviors>
|
||||
<KeyBindingTriggerBehaviour Gesture="Enter">
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
</KeyBindingTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class OpenWalletView : UserControl
|
||||
{
|
||||
public OpenWalletView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.PasswordEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:PasswordEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<TextBox
|
||||
Classes="revealPasswordButton"
|
||||
PasswordChar="●"
|
||||
Text="{Binding Value}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class PasswordEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public PasswordEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.SearchWalletActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:SearchWalletActionViewModel">
|
||||
<UserControl.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.ThemeDictionaries>
|
||||
<ResourceDictionary x:Key="Light">
|
||||
<StaticResource x:Key="TextControlBorderBrush" ResourceKey="ControlStrokeColorDefaultBrush" />
|
||||
<StaticResource x:Key="TextControlBorderBrushPointerOver" ResourceKey="ControlStrokeColorDefaultBrush" />
|
||||
<StaticResource x:Key="TextControlBorderBrushFocused" ResourceKey="ControlStrokeColorDefaultBrush" />
|
||||
</ResourceDictionary>
|
||||
<ResourceDictionary x:Key="Dark">
|
||||
<StaticResource x:Key="TextControlBorderBrush" ResourceKey="ControlStrokeColorDefaultBrush" />
|
||||
<StaticResource x:Key="TextControlBorderBrushPointerOver" ResourceKey="ControlStrokeColorDefaultBrush" />
|
||||
<StaticResource x:Key="TextControlBorderBrushFocused" ResourceKey="ControlStrokeColorDefaultBrush" />
|
||||
</ResourceDictionary>
|
||||
</ResourceDictionary.ThemeDictionaries>
|
||||
</ResourceDictionary>
|
||||
</UserControl.Resources>
|
||||
<AutoCompleteBox
|
||||
MaxWidth="500"
|
||||
CornerRadius="16"
|
||||
Text="{Binding Value}"
|
||||
TextBlock.TextAlignment="Center"
|
||||
Watermark="Search">
|
||||
<Interaction.Behaviors>
|
||||
<KeyBindingTriggerBehaviour Gesture="Enter">
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
</KeyBindingTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</AutoCompleteBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class SearchWalletActionView : UserControl
|
||||
{
|
||||
public SearchWalletActionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Wallet.Avalonia.StarredNavigationView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:StarredNavigationViewModel"
|
||||
Content="Starred"
|
||||
IsSelected="{Binding Selected, Mode=TwoWay}">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Wallet">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
<Parameter Key="Transition" Value="FromRight" />
|
||||
<Parameter Key="NavigationStackEnabled" Value="{x:True}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</NavigationViewItem>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class StarredNavigationView : NavigationViewItem
|
||||
{
|
||||
public StarredNavigationView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.TextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:TextEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<TextBox Text="{Binding Value}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="MinWidth" Value="0" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class TextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public TextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.UnarchiveItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:UnarchiveItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Unarchive">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource FluentThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class UnarchiveItemActionView : UserControl
|
||||
{
|
||||
public UnarchiveItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<LangVersion>latest</LangVersion>
|
||||
<AvaloniaUseCompiledBindingsByDefault>true</AvaloniaUseCompiledBindingsByDefault>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<AvaloniaResource Include="Assets\**" />
|
||||
</ItemGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<DefineConstants>$(DefineConstants);ENABLE_XAML_HOT_RELOAD</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Condition="$(DefineConstants.Contains(ENABLE_XAML_HOT_RELOAD))" Include="Avalonia.Markup.Xaml.Loader" Version="11.1.0-beta2" />
|
||||
<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-beta2" />
|
||||
<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="System.Reactive" Version="6.0.1" />
|
||||
<PackageReference Include="Avalonia.Xaml.Behaviors" Version="11.1.0-beta2.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0-preview.4.24266.19" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0-preview.4.24267.1">
|
||||
<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-beta2" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.Avalonia\Toolkit.Avalonia.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.Foundation\Toolkit.Foundation.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Avalonia\Toolkit.UI.Avalonia.csproj" />
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj" />
|
||||
<ProjectReference Include="..\Wallet\Wallet.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="AddItemNavigationView.axaml.cs">
|
||||
<DependentUpon>AddItemNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemCategoryNavigationView.axaml.cs">
|
||||
<DependentUpon>ItemCategoryNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemCategoryCollectionView.axaml.cs">
|
||||
<DependentUpon>ItemCategoryCollectionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemCollectionView.axaml.cs">
|
||||
<DependentUpon>ItemCollectionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="CreateItemActionView.axaml.cs">
|
||||
<DependentUpon>CreateItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemCommandHeaderView.axaml.cs">
|
||||
<DependentUpon>ItemCommandHeaderView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ConfirmItemActionView.axaml.cs">
|
||||
<DependentUpon>ConfirmItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="CreateWalletNavigationView.axaml.cs">
|
||||
<DependentUpon>CreateWalletNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="CreateWalletView.axaml.cs">
|
||||
<DependentUpon>CreateWalletView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="DismissItemActionView.axaml.cs">
|
||||
<DependentUpon>DismissItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="DropdownEntryView.axaml.cs">
|
||||
<DependentUpon>DropdownEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemHeaderView.axaml.cs">
|
||||
<DependentUpon>ItemHeaderView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemContentView.axaml.cs">
|
||||
<DependentUpon>ItemContentView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TextEntryView.axaml.cs">
|
||||
<DependentUpon>TextEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="PasswordEntryView.axaml.cs">
|
||||
<DependentUpon>PasswordEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="MaskedTextEntryView.axaml.cs">
|
||||
<DependentUpon>MaskedTextEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="OpenWalletView.axaml.cs">
|
||||
<DependentUpon>OpenWalletView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ManageNavigationView.axaml.cs">
|
||||
<DependentUpon>ManageNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="WalletHeaderView.axaml.cs">
|
||||
<DependentUpon>WalletHeaderView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemNavigationView.axaml.cs">
|
||||
<DependentUpon>ItemNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemView.axaml.cs">
|
||||
<DependentUpon>ItemView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="WalletNavigationView.axaml.cs">
|
||||
<DependentUpon>WalletNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="WalletView.axaml.cs">
|
||||
<DependentUpon>WalletView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="SearchWalletActionView.axaml.cs">
|
||||
<DependentUpon>SearchWalletActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,19 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.WalletHeaderView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:WalletHeaderViewModel">
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Grid ColumnDefinitions="Auto,6,*" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.Styles>
|
||||
<Style Selector="ContentPresenter">
|
||||
<Setter Property="Grid.Column" Value="{ReflectionBinding Index}" />
|
||||
</Style>
|
||||
</ItemsControl.Styles>
|
||||
</ItemsControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class WalletHeaderView : UserControl
|
||||
{
|
||||
public WalletHeaderView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,114 @@
|
||||
<NavigationViewItem
|
||||
x:Class="Wallet.Avalonia.WalletNavigationView"
|
||||
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:Name="NavigationViewItem"
|
||||
x:DataType="vm:WalletNavigationViewModel"
|
||||
Content="{Binding Name}"
|
||||
IsExpanded="{Binding Expanded}"
|
||||
MenuItemsSource="{Binding}"
|
||||
NavigationViewExtension.IsItemInvokedEnabled="True"
|
||||
SelectsOnInvoked="True">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="False">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Selected}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="OpenWallet">
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
</NavigateAction>
|
||||
<ChangePropertyAction
|
||||
PropertyName="SelectsOnInvoked"
|
||||
TargetObject="{Binding #NavigationViewItem}"
|
||||
Value="True" />
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="True">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Selected}" RightOperand="True" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<ChangePropertyAction
|
||||
PropertyName="SelectsOnInvoked"
|
||||
TargetObject="{Binding #NavigationViewItem}"
|
||||
Value="False" />
|
||||
<InvokeNavigationViewItemAction />
|
||||
</ConditionAction>
|
||||
</DataTriggerBehavior>
|
||||
<AttachedBehaviour>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="OpenWallet">
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="True" />
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Wallet" />
|
||||
<InvokeNavigationViewItemAction />
|
||||
</ConditionAction>
|
||||
</AttachedBehaviour>
|
||||
<AttachedEventTriggerBehaviour RoutedEvent="{x:Static NavigationViewExtension.ItemInvokedEvent}">
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="OpenWallet">
|
||||
<Parameter Key="Name" Value="{Binding Name}" />
|
||||
</NavigateAction>
|
||||
</ConditionAction>
|
||||
<ConditionAction>
|
||||
<ConditionAction.Condition>
|
||||
<ConditionalExpression ForwardChaining="And">
|
||||
<ComparisonCondition LeftOperand="{Binding Opened}" RightOperand="True" />
|
||||
<ComparisonCondition LeftOperand="{Binding Activated}" RightOperand="False" />
|
||||
</ConditionalExpression>
|
||||
</ConditionAction.Condition>
|
||||
<NavigateAction Region="Main" Route="Wallet" />
|
||||
<InvokeNavigationViewItemAction />
|
||||
</ConditionAction>
|
||||
</AttachedEventTriggerBehaviour>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="False">
|
||||
<RemoveClassAction ClassName="Closed" />
|
||||
<AddClassAction ClassName="Closed" RemoveIfExists="True" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding Opened}" Value="True">
|
||||
<RemoveClassAction ClassName="Opened" />
|
||||
<AddClassAction ClassName="Opened" RemoveIfExists="True" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
<NavigationViewItem.Styles>
|
||||
<Style Selector="ui|NavigationViewItem.Closed">
|
||||
<Setter Property="IconSource">
|
||||
<Setter.Value>
|
||||
<PathIconSource Data="M512,757.76C525.653,757.76 537.6,752.64 547.84,742.4C558.08,732.16 563.2,720.213 563.2,706.56C563.2,692.907 558.08,680.96 547.84,670.72C537.6,660.48 525.653,655.36 512,655.36C498.347,655.36 486.4,660.48 476.16,670.72C465.92,680.96 460.8,692.907 460.8,706.56C460.8,720.213 465.92,732.16 476.16,742.4C486.4,752.64 498.347,757.76 512,757.76ZM307.2,399.36L358.4,399.36L358.4,348.16C358.4,305.835 373.419,269.653 403.456,239.616C433.493,209.579 469.675,194.56 512,194.56C554.325,194.56 590.507,209.579 620.544,239.616C650.581,269.653 665.6,305.835 665.6,348.16L665.6,399.36L716.8,399.36C759.125,399.36 795.307,414.379 825.344,444.416C855.381,474.453 870.4,510.635 870.4,552.96L870.4,860.16C870.4,902.485 855.381,938.667 825.344,968.704C795.307,998.741 759.125,1013.76 716.8,1013.76L307.2,1013.76C264.875,1013.76 228.693,998.741 198.656,968.704C168.619,938.667 153.6,902.485 153.6,860.16L153.6,552.96C153.6,510.635 168.619,474.453 198.656,444.416C228.693,414.379 264.875,399.36 307.2,399.36ZM512,245.76C483.328,245.76 459.093,255.659 439.296,275.456C419.499,295.253 409.6,319.488 409.6,348.16L409.6,399.36L614.4,399.36L614.4,348.16C614.4,319.488 604.501,295.253 584.704,275.456C564.907,255.659 540.672,245.76 512,245.76ZM819.2,552.96C819.2,524.288 809.301,500.053 789.504,480.256C769.707,460.459 745.472,450.56 716.8,450.56L307.2,450.56C278.528,450.56 254.293,460.459 234.496,480.256C214.699,500.053 204.8,524.288 204.8,552.96L204.8,860.16C204.8,888.832 214.699,913.067 234.496,932.864C254.293,952.661 278.528,962.56 307.2,962.56L716.8,962.56C745.472,962.56 769.707,952.661 789.504,932.864C809.301,913.067 819.2,888.832 819.2,860.16Z" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
<Style Selector="ui|NavigationViewItem.Opened">
|
||||
<Setter Property="IconSource">
|
||||
<Setter.Value>
|
||||
<PathIconSource Data="M512,757.76C525.653,757.76 537.6,752.64 547.84,742.4C558.08,732.16 563.2,720.213 563.2,706.56C563.2,692.907 558.08,680.96 547.84,670.72C537.6,660.48 525.653,655.36 512,655.36C498.347,655.36 486.4,660.48 476.16,670.72C465.92,680.96 460.8,692.907 460.8,706.56C460.8,720.213 465.92,732.16 476.16,742.4C486.4,752.64 498.347,757.76 512,757.76ZM768,194.56C739.328,194.56 715.093,204.459 695.296,224.256C675.499,244.053 665.6,268.288 665.6,296.96L665.6,399.36L716.8,399.36C759.125,399.36 795.307,414.379 825.344,444.416C855.381,474.453 870.4,510.635 870.4,552.96L870.4,860.16C870.4,902.485 855.381,938.667 825.344,968.704C795.307,998.741 759.125,1013.76 716.8,1013.76L307.2,1013.76C264.875,1013.76 228.693,998.741 198.656,968.704C168.619,938.667 153.6,902.485 153.6,860.16L153.6,552.96C153.6,510.635 168.619,474.453 198.656,444.416C228.693,414.379 264.875,399.36 307.2,399.36L614.4,399.36L614.4,296.96C614.4,254.635 629.419,218.453 659.456,188.416C689.493,158.379 725.675,143.36 768,143.36C810.325,143.36 846.507,158.379 876.544,188.416C906.581,218.453 921.6,254.635 921.6,296.96L921.6,321.536C921.6,329.728 919.211,336.213 914.432,340.992C909.653,345.771 903.509,348.16 896,348.16C888.491,348.16 882.347,345.771 877.568,340.992C872.789,336.213 870.4,330.411 870.4,323.584L870.4,296.96C870.4,268.288 860.501,244.053 840.704,224.256C820.907,204.459 796.672,194.56 768,194.56ZM716.8,450.56L307.2,450.56C278.528,450.56 254.293,460.459 234.496,480.256C214.699,500.053 204.8,524.288 204.8,552.96L204.8,860.16C204.8,888.832 214.699,913.067 234.496,932.864C254.293,952.661 278.528,962.56 307.2,962.56L716.8,962.56C745.472,962.56 769.707,952.661 789.504,932.864C809.301,913.067 819.2,888.832 819.2,860.16L819.2,552.96C819.2,524.288 809.301,500.053 789.504,480.256C769.707,460.459 745.472,450.56 716.8,450.56Z" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</NavigationViewItem.Styles>
|
||||
</NavigationViewItem>
|
||||
@@ -0,0 +1,9 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class WalletNavigationView : NavigationViewItem
|
||||
{
|
||||
public WalletNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
<UserControl
|
||||
x:Class="Wallet.Avalonia.WalletView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:WalletViewModel">
|
||||
<Grid
|
||||
x:Name="Container"
|
||||
ColumnDefinitions="320,Auto,*,Auto"
|
||||
Grid.IsSharedSizeScope="True"
|
||||
RowDefinitions="Auto,*">
|
||||
<Grid
|
||||
Grid.Row="0"
|
||||
Grid.ColumnSpan="3"
|
||||
Height="44"
|
||||
Margin="4,2,0,0">
|
||||
<ContentControl VerticalAlignment="Center">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateAction Region="{Binding $self}" Route="WalletHeader" />
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
<Frame Grid.Row="1" Grid.Column="0">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="Left">
|
||||
<NavigateAction Region="Left" Route="ContentItemCollection">
|
||||
<Parameter Key="Filter" Value="{Binding Filter}" />
|
||||
</NavigateAction>
|
||||
</NavigateRegionAction>
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</Frame>
|
||||
<GridSplitter
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
MinWidth="2"
|
||||
MaxWidth="2"
|
||||
Background="Transparent" />
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
|
||||
BorderThickness="1,1,0,0"
|
||||
CornerRadius="8 0 0 0">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Height="44"
|
||||
Padding="4">
|
||||
<ContentControl>
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="{Binding Named, StringFormat='{}{0}:ContentHeader'}" />
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<ContentControl Grid.Row="1">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="{Binding Named, StringFormat='{}{0}:Content'}" />
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,20 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class WalletView : UserControl
|
||||
{
|
||||
public WalletView() => InitializeComponent();
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs args)
|
||||
{
|
||||
base.OnLoaded(args);
|
||||
|
||||
if (VisualRoot is AppWindow appWindow)
|
||||
{
|
||||
Container.ColumnDefinitions[3].Width = new GridLength(appWindow.TitleBar.RightInset, GridUnitType.Pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user