wip
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
BorderThickness="0"
|
||||
Content=""
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.AddVaultContentHeaderView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:AddVaultContentHeaderViewModel">
|
||||
<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,12 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
{
|
||||
public partial class AddVaultContentHeaderView : UserControl
|
||||
{
|
||||
public AddVaultContentHeaderView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,5 +2,48 @@
|
||||
x:Class="Bitvault.Avalonia.AddVaultContentView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
Add vault content placeholder
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Loaded">
|
||||
<NavigateAction Context="ContentHeader" Route="AddVaultContentHeader" />
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
<Grid>
|
||||
<Grid.Styles>
|
||||
<Style Selector="Border">
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="BorderBrush" Value="DarkGray" />
|
||||
<Setter Property="Margin" Value="3" />
|
||||
<Setter Property="Background" Value="LightGray" />
|
||||
<Setter Property="Height" Value="60" />
|
||||
</Style>
|
||||
<Style Selector="Border.Header">
|
||||
<Setter Property="ResponsiveGrid.ExtraSmall" Value="12" />
|
||||
</Style>
|
||||
<Style Selector="Border.Section1">
|
||||
<Setter Property="ResponsiveGrid.ExtraSmall" Value="6" />
|
||||
<Setter Property="ResponsiveGrid.Small" Value="3" />
|
||||
<Setter Property="ResponsiveGrid.Medium" Value="2" />
|
||||
</Style>
|
||||
<Style Selector="Border.Section2">
|
||||
<Setter Property="ResponsiveGrid.ExtraSmall" Value="12" />
|
||||
<Setter Property="ResponsiveGrid.Small" Value="6" />
|
||||
<Setter Property="ResponsiveGrid.Medium" Value="2" />
|
||||
</Style>
|
||||
<Style Selector="Border.Footer">
|
||||
<Setter Property="ResponsiveGrid.ExtraSmall" Value="12" />
|
||||
</Style>
|
||||
</Grid.Styles>
|
||||
|
||||
<ResponsiveGrid>
|
||||
<Border Classes="Header" />
|
||||
<Border Classes="Section1" />
|
||||
<Border Classes="Section1" />
|
||||
<Border Classes="Section1" />
|
||||
<Border Classes="Section1" />
|
||||
<Border Classes="Section2" />
|
||||
<Border Classes="Section2" />
|
||||
<Border Classes="Footer" />
|
||||
</ResponsiveGrid>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
||||
RequestedThemeVariant="Default">
|
||||
<Application.Styles>
|
||||
<ThemeResources PreferUserAccentColor="True" />
|
||||
<ThemeResources PreferSystemTheme="True" PreferUserAccentColor="True" />
|
||||
<Style Selector="ui|SettingsExpanderItem">
|
||||
<Style Selector="^ /template/ Expander#Expander">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
|
||||
@@ -75,10 +75,15 @@ public partial class App : Application
|
||||
services.AddTemplate<VaultSearchHeaderViewModel, VaultSearchHeaderView>("VaultSearchHeader");
|
||||
services.AddTemplate<VaultHeaderViewModel, VaultHeaderView>("VaultHeader");
|
||||
services.AddTemplate<AddVaultContentActionViewModel, AddVaultContentActionView>();
|
||||
services.AddTemplate<AddVaultContentViewModel, AddVaultContentView>("AddVaultContent");
|
||||
services.AddTemplate<VaultContentViewModel, VaultContentView>("VaultContent");
|
||||
|
||||
services.AddTemplate<VaultContentNavigationViewModel, VaultContentNavigationView>();
|
||||
services.AddTemplate<VaultContentViewModel, VaultContentView>("VaultContent");
|
||||
|
||||
services.AddTemplate<AddVaultContentViewModel, AddVaultContentView>("AddVaultContent");
|
||||
services.AddTemplate<AddVaultContentHeaderViewModel, AddVaultContentHeaderView>("AddVaultContentHeader");
|
||||
|
||||
services.AddTemplate<ConfirmVaultContentActionViewModel, ConfirmVaultContentActionView>();
|
||||
services.AddTemplate<DismissVaultContentActionViewModel, DismissVaultContentActionView>();
|
||||
});
|
||||
})!);
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.ConfirmVaultContentActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Save">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ConfirmVaultContentActionView : UserControl
|
||||
{
|
||||
public ConfirmVaultContentActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.DismissVaultContentActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Save">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="󸁞" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class DismissVaultContentActionView : UserControl
|
||||
{
|
||||
public DismissVaultContentActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -9,7 +9,7 @@
|
||||
TransparencyLevelHint="Mica">
|
||||
<ContentControl x:Name="Window">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<AttachedBehaviour>
|
||||
<NavigateAction Context="Window" Route="Main" />
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
Content="{Binding Name}">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding Selected}" Value="True">
|
||||
<NavigateAction Context="Content" Route="AddVaultContent" />
|
||||
<NavigateAction Context="Content" Route="VaultContent" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</ListBoxItem>
|
||||
|
||||
@@ -4,6 +4,14 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:VaultHeaderViewModel">
|
||||
<UserControl.Resources>
|
||||
<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>
|
||||
</UserControl.Resources>
|
||||
<Grid ColumnDefinitions="*,Auto">
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -4,14 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:VaultViewModel">
|
||||
<UserControl.Resources>
|
||||
<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}" />
|
||||
</UserControl.Resources>
|
||||
<Grid ColumnDefinitions="320,*" RowDefinitions="Auto,*">
|
||||
<Grid ColumnDefinitions="320,Auto,*" RowDefinitions="Auto,*">
|
||||
<ContentControl
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
@@ -35,9 +28,29 @@
|
||||
</Style>
|
||||
</ListBox.Styles>
|
||||
</ListBox>
|
||||
<Frame
|
||||
x:Name="Content"
|
||||
<GridSplitter
|
||||
Grid.Row="1"
|
||||
Grid.Column="1" />
|
||||
Grid.Column="1"
|
||||
MinWidth="2"
|
||||
MaxWidth="2"
|
||||
Background="Transparent" />
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Grid.Column="2"
|
||||
Background="{DynamicResource CardBackgroundFillColorDefaultBrush}"
|
||||
BorderBrush="{DynamicResource ControlStrokeColorDefaultBrush}"
|
||||
BorderThickness="1,1,0,0"
|
||||
CornerRadius="8 0 0 0">
|
||||
<Grid RowDefinitions="Auto, *">
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Padding="4"
|
||||
BorderBrush="{DynamicResource DividerStrokeColorDefaultBrush}"
|
||||
BorderThickness="0,0,0,1">
|
||||
<ContentControl x:Name="ContentHeader" />
|
||||
</Border>
|
||||
<Frame x:Name="Content" Grid.Row="1" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -3,8 +3,8 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
[NavigationTarget("Header")]
|
||||
[NavigationTarget("Content")]
|
||||
[NavigationTarget("ContentHeader")]
|
||||
public partial class VaultView : UserControl
|
||||
{
|
||||
public VaultView() => InitializeComponent();
|
||||
|
||||
@@ -7,4 +7,4 @@ public partial class AddVaultContentActionViewModel(IServiceProvider provider,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
@@ -0,0 +1,22 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class AddVaultContentHeaderViewModel : ObservableCollectionViewModel
|
||||
{
|
||||
public AddVaultContentHeaderViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
Add<ConfirmVaultContentActionViewModel>();
|
||||
Add<DismissVaultContentActionViewModel>();
|
||||
|
||||
Template = template;
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
}
|
||||
@@ -2,9 +2,15 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class AddVaultContentViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
public partial class AddVaultContentViewModel : ObservableCollectionViewModel
|
||||
{
|
||||
public AddVaultContentViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ConfirmVaultContentActionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
@@ -21,8 +21,6 @@ public partial class CreateVaultViewModel(IServiceProvider provider,
|
||||
[ObservableProperty]
|
||||
private string password;
|
||||
|
||||
public async Task<bool> Confirm()
|
||||
{
|
||||
return await Mediator.Handle<Create<Vault>, bool>(Create.As(new Vault(Name, Password)));
|
||||
}
|
||||
public async Task<bool> Confirm() =>
|
||||
await Mediator.Handle<Create<Vault>, bool>(Create.As(new Vault(Name, Password)));
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class DeleteVaultContentActionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class DismissVaultContentActionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class EditVaultContentActionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class IconPickerViewModel : ObservableViewModel
|
||||
{
|
||||
public IconPickerViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class IconViewModel : ObservableViewModel
|
||||
{
|
||||
public IconViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class NoteViewModel : ObservableViewModel
|
||||
{
|
||||
public NoteViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class PasswordViewModel : ObservableViewModel
|
||||
{
|
||||
public PasswordViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class TextViewModel : ObservableViewModel
|
||||
{
|
||||
public TextViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public class VaultConnectionPersistence :
|
||||
IVaultConnectionPersistence,
|
||||
IDisposable
|
||||
{
|
||||
private string? connection;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
connection = null;
|
||||
}
|
||||
|
||||
public string? Get(string key)
|
||||
{
|
||||
return connection;
|
||||
}
|
||||
|
||||
public void Set(string key,
|
||||
string connection)
|
||||
{
|
||||
this.connection = connection;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class VaultContentHeaderViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer) : ObservableViewModel(provider, factory, mediator, publisher, subscriber, disposer);
|
||||
Reference in New Issue
Block a user