WIP
This commit is contained in:
@@ -66,7 +66,9 @@ public partial class App : Application
|
||||
{
|
||||
args.UseSqlite($"{connection.Value}");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
services.AddHandler<QueryContainerHandler>(ServiceLifetime.Singleton);
|
||||
|
||||
services.AddHandler<OpenContainerHandler>();
|
||||
|
||||
@@ -78,10 +80,12 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<OpenContainerViewModel, OpenView>("OpenContainer");
|
||||
|
||||
services.AddTemplate<ContainerViewModel, ContainerView>("Container");
|
||||
services.AddHandler<ContainerViewModelHandler>();
|
||||
services.AddScoped<ContainerViewModelConfiguration>();
|
||||
|
||||
services.AddTemplate<SearchHeaderViewModel, SearchHeaderView>("SearchHeader");
|
||||
services.AddTemplate<ContainerViewModel, ContainerView>("Container");
|
||||
services.AddHandler<EnumerateContainerViewModelHandler>();
|
||||
|
||||
services.AddTemplate<SearchContainerActionViewModel, SearchContainerActionView>();
|
||||
services.AddTemplate<ContainerHeaderViewModel, ContainerHeaderView>("ContainerHeader");
|
||||
services.AddTemplate<CreateItemActionViewModel, CreateItemActionView>();
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
|
||||
@@ -79,9 +79,6 @@
|
||||
<Compile Update="ContainerNavigationView.axaml.cs">
|
||||
<DependentUpon>ContainerNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="SearchHeaderView.axaml.cs">
|
||||
<DependentUpon>SearchHeaderView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ContainerView.axaml.cs">
|
||||
<DependentUpon>ContainerView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
@@ -4,32 +4,5 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ContainerHeaderViewModel">
|
||||
<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"
|
||||
Margin="16,0,0,0"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Value}"
|
||||
Theme="{DynamicResource BodyStrongTextBlockStyle}" />
|
||||
<ItemsControl
|
||||
Grid.Column="1"
|
||||
Margin="0,0,4,0"
|
||||
VerticalAlignment="Center"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<StackPanel Orientation="Horizontal" />
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</Grid>
|
||||
<ItemsControl ItemTemplate="{ReflectionBinding Template}" ItemsSource="{Binding}" />
|
||||
</UserControl>
|
||||
|
||||
@@ -5,17 +5,20 @@
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ContainerViewModel">
|
||||
<Grid ColumnDefinitions="320,Auto,*" RowDefinitions="Auto,*">
|
||||
<ContentControl
|
||||
<Grid
|
||||
x:Name="Title"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Height="40"
|
||||
Margin="4,4,0,0">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateAction Region="{Binding $self}" Route="ContainerHeader" />
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
Grid.ColumnSpan="3"
|
||||
Height="44"
|
||||
ColumnDefinitions="*, Auto">
|
||||
<ContentControl Grid.Column="0" VerticalAlignment="Center">
|
||||
<Interaction.Behaviors>
|
||||
<AttachedBehaviour>
|
||||
<NavigateAction Region="{Binding $self}" Route="ContainerHeader" />
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</ContentControl>
|
||||
</Grid>
|
||||
<ListBox
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
|
||||
@@ -1,8 +1,20 @@
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Interactivity;
|
||||
using FluentAvalonia.UI.Windowing;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ContainerView : UserControl
|
||||
{
|
||||
public ContainerView() => InitializeComponent();
|
||||
|
||||
protected override void OnLoaded(RoutedEventArgs args)
|
||||
{
|
||||
base.OnLoaded(args);
|
||||
|
||||
if (VisualRoot is AppWindow appWindow)
|
||||
{
|
||||
Title.ColumnDefinitions[1].Width = new GridLength(appWindow.TitleBar.RightInset, GridUnitType.Pixel);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,11 +14,11 @@
|
||||
</NavigationView.Resources>
|
||||
<Frame>
|
||||
<Interaction.Behaviors>
|
||||
<EventTriggerBehavior EventName="Loaded">
|
||||
<AttachedBehaviour>
|
||||
<NavigateRegionAction Name="Main">
|
||||
<NavigateAction Region="Main" Route="Container" />
|
||||
</NavigateRegionAction>
|
||||
</EventTriggerBehavior>
|
||||
</AttachedBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</Frame>
|
||||
</NavigationView>
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.SearchContainerActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:SearchContainerActionViewModel">
|
||||
<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}"
|
||||
Watermark="Search">
|
||||
<Interaction.Behaviors>
|
||||
<KeyBindingTriggerBehaviour Gesture="Enter">
|
||||
<InvokeCommandAction Command="{Binding InvokeCommand}" />
|
||||
</KeyBindingTriggerBehaviour>
|
||||
</Interaction.Behaviors>
|
||||
</AutoCompleteBox>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class SearchContainerActionView : UserControl
|
||||
{
|
||||
public SearchContainerActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -1,6 +0,0 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.SearchHeaderView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<AutoCompleteBox VerticalAlignment="Center" />
|
||||
</UserControl>
|
||||
@@ -1,8 +0,0 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class SearchHeaderView : UserControl
|
||||
{
|
||||
public SearchHeaderView() => InitializeComponent();
|
||||
}
|
||||
Reference in New Issue
Block a user