Fix some edge cases
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class AddItemActionView : UserControl
|
||||
{
|
||||
public AddItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<SearchHeaderViewModel, SearchHeaderView>("SearchHeader");
|
||||
services.AddTemplate<ContainerHeaderViewModel, ContainerHeaderView>("ContainerHeader");
|
||||
services.AddTemplate<AddItemActionViewModel, AddItemActionView>();
|
||||
services.AddTemplate<CreateItemActionViewModel, CreateItemActionView>();
|
||||
|
||||
services.AddTemplate<ItemNavigationViewModel, ItemNavigationView>();
|
||||
services.AddTemplate<ItemViewModel, ItemView>("Item");
|
||||
@@ -92,6 +92,9 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ConfirmItemActionViewModel, ConfirmItemActionView>();
|
||||
services.AddTemplate<DismissItemActionViewModel, DismissItemActionView>();
|
||||
services.AddTemplate<ArchiveItemActionViewModel, ArchiveItemActionView>();
|
||||
services.AddTemplate<EditItemActionViewModel, EditItemActionView>();
|
||||
services.AddTemplate<DeleteItemActionViewModel, DeleteItemActionView>();
|
||||
|
||||
services.AddTemplate<ItemHeaderViewModel, ItemHeaderView>();
|
||||
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.ArchiveItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ArchiveItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Archive">
|
||||
<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 ArchiveItemActionView : UserControl
|
||||
{
|
||||
public ArchiveItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -40,8 +40,8 @@
|
||||
<ProjectReference Include="..\Toolkit\Toolkit.UI.Controls.Avalonia\Toolkit.UI.Controls.Avalonia.csproj" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="AddItemActionView.axaml.cs">
|
||||
<DependentUpon>AddItemActionView.axaml</DependentUpon>
|
||||
<Compile Update="CreateItemActionView.axaml.cs">
|
||||
<DependentUpon>CreateItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemCommandHeaderView.axaml.cs">
|
||||
<DependentUpon>ItemCommandHeaderView.axaml</DependentUpon>
|
||||
|
||||
@@ -21,7 +21,9 @@
|
||||
Grid.Column="0"
|
||||
Margin="2,-1,0,0"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}">
|
||||
ItemsSource="{Binding}"
|
||||
SelectedIndex="{Binding SelectedIndex}"
|
||||
SelectionMode="AlwaysSelected">
|
||||
<ListBox.Styles>
|
||||
<Style Selector="ListBoxItem">
|
||||
<Setter Property="IsSelected" Value="{ReflectionBinding Selected}" />
|
||||
|
||||
+7
-3
@@ -1,9 +1,9 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.AddItemActionView"
|
||||
x:Class="Bitvault.Avalonia.CreateItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:AddItemActionViewModel">
|
||||
x:DataType="vm:CreateItemActionViewModel">
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
@@ -22,7 +22,11 @@
|
||||
<NavigateAction
|
||||
Context="{Binding Named, StringFormat='{}{0}:Content'}"
|
||||
Route="Item"
|
||||
Scope="self" />
|
||||
Scope="self">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Immutable" Value="{x:False}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
</NavigateAction>
|
||||
</EventTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</Button>
|
||||
@@ -0,0 +1,8 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class CreateItemActionView : UserControl
|
||||
{
|
||||
public CreateItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.DeleteItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:DeleteItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Delete">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="16"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
Text="" />
|
||||
</Button>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
{
|
||||
public partial class DeleteItemActionView : UserControl
|
||||
{
|
||||
public DeleteItemActionView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Save">
|
||||
ToolTip.Tip="Cancel">
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
<UserControl
|
||||
x:Class="Bitvault.Avalonia.EditItemActionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:EditItemActionViewModel">
|
||||
<Button
|
||||
Width="{StaticResource ButtonWidth}"
|
||||
Height="{StaticResource ButtonHeight}"
|
||||
VerticalAlignment="Center"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Foreground="{DynamicResource IconForegroundBrush}"
|
||||
ToolTip.Tip="Edit">
|
||||
<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 EditItemActionView : UserControl
|
||||
{
|
||||
public EditItemActionView() => InitializeComponent();
|
||||
}
|
||||
@@ -11,7 +11,15 @@
|
||||
DisplayName="{Binding Value}" />
|
||||
<TextBox
|
||||
MaxWidth="360"
|
||||
IsVisible="{Binding !Immutable}"
|
||||
Text="{Binding Value}"
|
||||
TextAlignment="Center"
|
||||
Watermark="Enter name" />
|
||||
<SelectableTextBlock
|
||||
MaxWidth="360"
|
||||
IsVisible="{Binding Immutable}"
|
||||
SelectionBrush="Red"
|
||||
Text="{Binding Value}"
|
||||
TextAlignment="Center" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
Scope="self" />
|
||||
<NavigateAction Context="{Binding Named, StringFormat='{}{0}:Content'}" Route="Item">
|
||||
<NavigateAction.ParameterBindings>
|
||||
<ParameterBinding Key="Immutable" Value="{x:True}" />
|
||||
<ParameterBinding Key="Id" Value="{Binding Id}" />
|
||||
<ParameterBinding Key="Name" Value="{Binding Name}" />
|
||||
</NavigateAction.ParameterBindings>
|
||||
|
||||
Reference in New Issue
Block a user