Make it possible to remove enteries

This commit is contained in:
TheXamlGuy
2024-08-01 23:19:30 +01:00
parent 9e25f7ea60
commit 0c21ddd20d
8 changed files with 234 additions and 245 deletions
+1 -1
View File
@@ -5,4 +5,4 @@
xmlns:vm="using:Wallet"
x:DataType="vm:CommentEntryViewModel"
Content="{Binding Comment}"
Description="{Binding Created}" />
Description="{Binding Created, StringFormat=f}" />
-53
View File
@@ -1,53 +0,0 @@
<UserControl
x:Class="Wallet.Avalonia.DeleteItemEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Wallet"
x:CompileBindings="False"
DataContext="{Binding $parent[SettingsExpander].DataContext}">
<UserControl.Resources>
<Thickness x:Key="MoreButtonMargin">0,0,12,0</Thickness>
<Thickness x:Key="MoreButtonPadding">5,0,5,0</Thickness>
<x:Double x:Key="MoreButtonMinWidth">32</x:Double>
<x:Double x:Key="MoreButtonMinHeight">32</x:Double>
</UserControl.Resources>
<Button
Grid.Column="1"
MinWidth="{StaticResource MoreButtonMinWidth}"
MinHeight="{StaticResource MoreButtonMinHeight}"
Margin="{StaticResource MoreButtonMargin}"
Padding="{StaticResource MoreButtonPadding}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Theme="{StaticResource TransparentButton}">
<Viewbox Width="14" Height="14">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 8.52 5.799999 L 11.52 5.799999 C 11.52 5.373333 11.373333 5.013332 11.08 4.719999 C 10.786666 4.426666 10.426666 4.286667 10 4.299999 C 9.573333 4.313334 9.219999 4.459999 8.94 4.74 C 8.66 5.02 8.52 5.373333 8.52 5.799999 Z M 7.52 5.799999 C 7.52 5.106667 7.759999 4.52 8.24 4.039999 C 8.719999 3.560001 9.306666 3.313334 10 3.299999 C 10.693333 3.286667 11.28 3.526667 11.759999 4.02 C 12.239999 4.513334 12.479999 5.106667 12.48 5.799999 L 17.52 5.799999 C 17.653332 5.799999 17.766666 5.846666 17.859999 5.94 C 17.953331 6.033334 18 6.153334 18 6.299999 C 18 6.446667 17.953331 6.566668 17.859999 6.66 C 17.766666 6.753334 17.653332 6.8 17.52 6.799999 L 16.440001 6.799999 L 15.24 17.16 C 15.159999 17.906666 14.833332 18.533333 14.259999 19.039999 C 13.686666 19.546665 13.026666 19.799999 12.28 19.799999 L 7.72 19.799999 C 6.973333 19.799999 6.313333 19.546665 5.74 19.039999 C 5.166667 18.533333 4.84 17.906666 4.76 17.16 L 3.56 6.799999 L 2.52 6.799999 C 2.36 6.8 2.233333 6.753334 2.14 6.66 C 2.046667 6.566668 2 6.446667 2 6.299999 C 2 6.153334 2.046667 6.033334 2.14 5.94 C 2.233333 5.846666 2.36 5.799999 2.52 5.799999 Z M 5.76 17.039999 C 5.813333 17.546665 6.026666 17.966665 6.4 18.299999 C 6.773333 18.633333 7.213333 18.799999 7.72 18.799999 L 12.28 18.799999 C 12.786666 18.799999 13.226665 18.633333 13.599999 18.299999 C 13.973333 17.966665 14.186666 17.546665 14.24 17.039999 L 15.44 6.799999 L 4.56 6.799999 Z M 8.52 9.28 C 8.653333 9.306667 8.766666 9.366667 8.86 9.459999 C 8.953333 9.553333 9 9.666667 9 9.799999 L 9 15.799999 C 9 15.933332 8.953333 16.053333 8.86 16.16 C 8.766666 16.266666 8.646667 16.313332 8.5 16.299999 C 8.353333 16.286667 8.233333 16.233334 8.139999 16.139999 C 8.046666 16.046665 8 15.933332 8 15.799999 L 8 9.799999 C 8 9.666667 8.046666 9.546667 8.139999 9.44 C 8.233333 9.333334 8.346666 9.280001 8.48 9.28 Z M 12 9.799999 C 12 9.666667 11.953333 9.546667 11.86 9.44 C 11.766666 9.333334 11.646666 9.280001 11.5 9.28 C 11.353333 9.280001 11.233333 9.333334 11.139999 9.44 C 11.046666 9.546667 11 9.666667 11 9.799999 L 11 15.799999 C 11 15.933332 11.046666 16.046665 11.139999 16.139999 C 11.233333 16.233334 11.353333 16.286667 11.5 16.299999 C 11.646666 16.313332 11.766666 16.266666 11.86 16.16 C 11.953333 16.053333 12 15.933332 12 15.799999 Z "
Foreground="{DynamicResource SystemFillColorCriticalBrush}" />
</Viewbox>
<Button.Styles>
<Style Selector="Button.Hide">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="Button.Show">
<Setter Property="IsVisible" Value="False" />
</Style>
</Button.Styles>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</Button>
</UserControl>
@@ -1,13 +0,0 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
namespace Wallet.Avalonia;
public partial class DeleteItemEntryView : UserControl
{
public DeleteItemEntryView()
{
InitializeComponent();
}
}
+216 -173
View File
@@ -6,180 +6,223 @@
x:CompileBindings="False"
DataContext="{Binding $parent[SettingsExpander].DataContext}">
<UserControl.Resources>
<Thickness x:Key="MoreButtonMargin">12,0,0,0</Thickness>
<Thickness x:Key="MoreButtonPadding">5,0,5,0</Thickness>
<x:Double x:Key="MoreButtonMinWidth">32</x:Double>
<x:Double x:Key="MoreButtonMinHeight">32</x:Double>
<Thickness x:Key="ButtonMargin">12,0,0,0</Thickness>
<Thickness x:Key="ButtonPadding">0</Thickness>
<x:Double x:Key="ButtonMinWidth">32</x:Double>
<x:Double x:Key="ButtonMinHeight">32</x:Double>
</UserControl.Resources>
<Button
Grid.Column="1"
MinWidth="{StaticResource MoreButtonMinWidth}"
MinHeight="{StaticResource MoreButtonMinHeight}"
Margin="{StaticResource MoreButtonMargin}"
Padding="{StaticResource MoreButtonPadding}"
VerticalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Theme="{StaticResource TransparentButton}">
<Viewbox
Width="14"
Height="14"
Margin="0,2,0,0">
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 6.24 11.799999 C 6.239999 12.146667 6.119999 12.440001 5.88 12.679999 C 5.64 12.92 5.346666 13.039999 5 13.039999 C 4.653333 13.039999 4.36 12.92 4.12 12.679999 C 3.88 12.440001 3.76 12.146667 3.76 11.799999 C 3.76 11.453333 3.88 11.16 4.12 10.919999 C 4.36 10.679999 4.653333 10.559999 5 10.559999 C 5.346666 10.559999 5.64 10.679999 5.88 10.919999 C 6.119999 11.16 6.239999 11.453333 6.24 11.799999 Z M 11.24 11.799999 C 11.24 12.146667 11.12 12.440001 10.88 12.679999 C 10.639999 12.92 10.346666 13.039999 10 13.039999 C 9.653333 13.039999 9.359999 12.92 9.12 12.679999 C 8.879999 12.440001 8.76 12.146667 8.76 11.799999 C 8.76 11.453333 8.879999 11.16 9.12 10.919999 C 9.359999 10.679999 9.653333 10.559999 10 10.559999 C 10.346666 10.559999 10.639999 10.679999 10.88 10.919999 C 11.12 11.16 11.24 11.453333 11.24 11.799999 Z M 15 13.039999 C 15.346665 13.039999 15.639999 12.92 15.88 12.679999 C 16.119999 12.440001 16.24 12.146667 16.24 11.799999 C 16.24 11.453333 16.119999 11.16 15.88 10.919999 C 15.639999 10.679999 15.346665 10.559999 15 10.559999 C 14.653333 10.559999 14.36 10.679999 14.12 10.919999 C 13.879999 11.16 13.759998 11.453333 13.759999 11.799999 C 13.759998 12.146667 13.879999 12.440001 14.12 12.679999 C 14.36 12.92 14.653333 13.039999 15 13.039999 Z " />
</Viewbox>
<Button.Styles>
<Style Selector="Button.Hide">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="Button.Show">
<Setter Property="IsVisible" Value="True" />
</Style>
</Button.Styles>
<Button.Flyout>
<MenuFlyout>
<MenuItem
Width="216"
Command="{Binding RevealCommand}"
Header="Reveal">
<MenuItem.Styles>
<Style Selector="MenuItem.Hide">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="MenuItem.Show">
<Setter Property="IsVisible" Value="True" />
</Style>
</MenuItem.Styles>
<MenuItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 3.28 13.4 C 3.493333 12.333333 3.926666 11.373333 4.58 10.52 C 5.233333 9.666667 6.033333 9 6.98 8.52 C 7.926666 8.039999 8.933332 7.799999 10 7.799999 C 11.066666 7.799999 12.073333 8.039999 13.02 8.52 C 13.966666 9 14.766666 9.666667 15.42 10.52 C 16.073334 11.373333 16.52 12.333333 16.76 13.4 C 16.786667 13.533333 16.853333 13.639999 16.959999 13.719999 C 17.066666 13.799999 17.186665 13.826666 17.32 13.799999 C 17.453333 13.773333 17.559999 13.699999 17.639999 13.579999 C 17.719999 13.459999 17.746666 13.333333 17.719999 13.2 C 17.453333 11.973333 16.946667 10.873333 16.199999 9.9 C 15.453332 8.926666 14.539999 8.166667 13.46 7.62 C 12.379999 7.073334 11.226666 6.8 10 6.799999 C 8.773333 6.8 7.62 7.073334 6.54 7.62 C 5.46 8.166667 4.546667 8.926666 3.8 9.9 C 3.053333 10.873333 2.546666 11.973333 2.28 13.2 C 2.253333 13.333333 2.28 13.459999 2.36 13.579999 C 2.44 13.699999 2.546667 13.773333 2.68 13.799999 C 2.813333 13.826666 2.933333 13.799999 3.04 13.719999 C 3.146666 13.639999 3.226666 13.533333 3.28 13.4 Z M 10 9.799999 C 9.039999 9.799999 8.213333 10.139999 7.52 10.82 C 6.826666 11.5 6.486667 12.326666 6.5 13.299999 C 6.513333 14.273333 6.86 15.099999 7.54 15.779999 C 8.219999 16.459999 9.039999 16.799999 10 16.799999 C 10.959999 16.799999 11.786666 16.459999 12.48 15.779999 C 13.173332 15.099999 13.519999 14.273333 13.52 13.299999 C 13.519999 12.326666 13.173332 11.5 12.48 10.82 C 11.786666 10.139999 10.959999 9.799999 10 9.799999 Z M 7.52 13.28 C 7.493333 12.613334 7.726666 12.033333 8.22 11.539999 C 8.713333 11.046666 9.306666 10.799999 10 10.799999 C 10.693333 10.799999 11.28 11.046666 11.759999 11.539999 C 12.239999 12.033333 12.486666 12.62 12.5 13.299999 C 12.513332 13.98 12.273333 14.566667 11.78 15.059999 C 11.286667 15.553333 10.693333 15.799999 10 15.799999 C 9.306666 15.799999 8.719999 15.553333 8.24 15.059999 C 7.759999 14.566667 7.52 13.973333 7.52 13.28 Z " />
</MenuItem.Icon>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<StackPanel Orientation="Horizontal">
<Button
Grid.Column="1"
MinWidth="{StaticResource ButtonMinWidth}"
MinHeight="{StaticResource ButtonMinHeight}"
Margin="{StaticResource ButtonMargin}"
Padding="{StaticResource ButtonPadding}"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Command="{Binding RemoveCommand}"
Theme="{StaticResource TransparentButton}">
<Viewbox Height="20">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{StaticResource FluentThemeFontFamily}"
FontSize="16"
Foreground="{DynamicResource SystemFillColorCriticalBrush}"
Text="&#xE5B9;" />
</Viewbox>
<Button.Styles>
<Style Selector="Button.Hide">
<Setter Property="IsVisible" Value="True" />
</Style>
<Style Selector="Button.Show">
<Setter Property="IsVisible" Value="False" />
</Style>
</Button.Styles>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</Button>
<Button
Grid.Column="1"
MinWidth="{StaticResource ButtonMinWidth}"
MinHeight="{StaticResource ButtonMinHeight}"
Margin="{StaticResource ButtonMargin}"
Padding="{StaticResource ButtonPadding}"
VerticalAlignment="Center"
HorizontalContentAlignment="Center"
VerticalContentAlignment="Center"
Theme="{StaticResource TransparentButton}">
<Viewbox Height="20">
<TextBlock
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontFamily="{StaticResource FluentThemeFontFamily}"
FontSize="16"
Text="&#xEB09;" />
</Viewbox>
<Button.Styles>
<Style Selector="Button.Hide">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="Button.Show">
<Setter Property="IsVisible" Value="True" />
</Style>
</Button.Styles>
<Button.Flyout>
<MenuFlyout>
<MenuItem
Width="216"
Command="{Binding RevealCommand}"
Header="Reveal">
<MenuItem.Styles>
<Style Selector="MenuItem.Hide">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="MenuItem.Show">
<Setter Property="IsVisible" Value="True" />
</Style>
</MenuItem.Styles>
<MenuItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 3.28 13.4 C 3.493333 12.333333 3.926666 11.373333 4.58 10.52 C 5.233333 9.666667 6.033333 9 6.98 8.52 C 7.926666 8.039999 8.933332 7.799999 10 7.799999 C 11.066666 7.799999 12.073333 8.039999 13.02 8.52 C 13.966666 9 14.766666 9.666667 15.42 10.52 C 16.073334 11.373333 16.52 12.333333 16.76 13.4 C 16.786667 13.533333 16.853333 13.639999 16.959999 13.719999 C 17.066666 13.799999 17.186665 13.826666 17.32 13.799999 C 17.453333 13.773333 17.559999 13.699999 17.639999 13.579999 C 17.719999 13.459999 17.746666 13.333333 17.719999 13.2 C 17.453333 11.973333 16.946667 10.873333 16.199999 9.9 C 15.453332 8.926666 14.539999 8.166667 13.46 7.62 C 12.379999 7.073334 11.226666 6.8 10 6.799999 C 8.773333 6.8 7.62 7.073334 6.54 7.62 C 5.46 8.166667 4.546667 8.926666 3.8 9.9 C 3.053333 10.873333 2.546666 11.973333 2.28 13.2 C 2.253333 13.333333 2.28 13.459999 2.36 13.579999 C 2.44 13.699999 2.546667 13.773333 2.68 13.799999 C 2.813333 13.826666 2.933333 13.799999 3.04 13.719999 C 3.146666 13.639999 3.226666 13.533333 3.28 13.4 Z M 10 9.799999 C 9.039999 9.799999 8.213333 10.139999 7.52 10.82 C 6.826666 11.5 6.486667 12.326666 6.5 13.299999 C 6.513333 14.273333 6.86 15.099999 7.54 15.779999 C 8.219999 16.459999 9.039999 16.799999 10 16.799999 C 10.959999 16.799999 11.786666 16.459999 12.48 15.779999 C 13.173332 15.099999 13.519999 14.273333 13.52 13.299999 C 13.519999 12.326666 13.173332 11.5 12.48 10.82 C 11.786666 10.139999 10.959999 9.799999 10 9.799999 Z M 7.52 13.28 C 7.493333 12.613334 7.726666 12.033333 8.22 11.539999 C 8.713333 11.046666 9.306666 10.799999 10 10.799999 C 10.693333 10.799999 11.28 11.046666 11.759999 11.539999 C 12.239999 12.033333 12.486666 12.62 12.5 13.299999 C 12.513332 13.98 12.273333 14.566667 11.78 15.059999 C 11.286667 15.553333 10.693333 15.799999 10 15.799999 C 9.306666 15.799999 8.719999 15.553333 8.24 15.059999 C 7.759999 14.566667 7.52 13.973333 7.52 13.28 Z " />
</MenuItem.Icon>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="False">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsConcealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsRevealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsConcealed}" Value="False">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="False">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsConcealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsRevealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsConcealed}" Value="False">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</MenuItem>
<MenuItem
Width="216"
Classes="Hide"
Command="{Binding HideCommand}"
Header="Hide">
<MenuItem.Styles>
<Style Selector="MenuItem.Hide">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="MenuItem.Show">
<Setter Property="IsVisible" Value="True" />
</Style>
</MenuItem.Styles>
<MenuItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 2.84 3.959999 C 2.76 3.853333 2.646667 3.799999 2.5 3.799999 C 2.353333 3.799999 2.233333 3.846668 2.14 3.940001 C 2.046667 4.033333 2 4.153334 2 4.299999 C 2 4.446667 2.053333 4.560001 2.16 4.639999 L 5.64 8.16 C 4.786666 8.746668 4.066667 9.473333 3.48 10.339999 C 2.893333 11.206667 2.493333 12.16 2.28 13.2 C 2.253333 13.386666 2.306667 13.546666 2.44 13.679999 C 2.573333 13.813334 2.733333 13.846666 2.92 13.78 C 3.106666 13.713333 3.213333 13.586666 3.24 13.4 C 3.453333 12.466666 3.826667 11.606667 4.36 10.82 C 4.893333 10.033334 5.559999 9.386667 6.36 8.879999 L 7.96 10.44 C 7.4 10.866667 6.993333 11.4 6.74 12.039999 C 6.486666 12.679999 6.426666 13.34 6.56 14.02 C 6.693333 14.7 7.006666 15.286667 7.5 15.779999 C 7.993333 16.273333 8.58 16.586666 9.26 16.719999 C 9.94 16.853333 10.606666 16.799999 11.259999 16.559999 C 11.913332 16.32 12.439999 15.906666 12.84 15.32 L 17.16 19.639999 C 17.239998 19.746666 17.353333 19.799999 17.5 19.799999 C 17.646666 19.799999 17.766666 19.753332 17.859999 19.66 C 17.953331 19.566666 18 19.446667 18 19.299999 C 18 19.153332 17.946667 19.039999 17.84 18.959999 Z M 10.12 9.799999 L 13.48 13.16 C 13.453333 12.253333 13.113333 11.473333 12.46 10.82 C 11.806666 10.166666 11.026667 9.826666 10.12 9.799999 Z M 7.52 7.2 L 8.32 8 C 8.879999 7.866667 9.44 7.799999 10 7.799999 C 11.066666 7.799999 12.073333 8.039999 13.02 8.52 C 13.966666 9 14.766666 9.666667 15.42 10.52 C 16.073334 11.373333 16.52 12.333333 16.76 13.4 C 16.786667 13.533333 16.853333 13.639999 16.959999 13.719999 C 17.066666 13.799999 17.186665 13.826666 17.32 13.799999 C 17.453333 13.773333 17.559999 13.699999 17.639999 13.579999 C 17.719999 13.459999 17.746666 13.333333 17.719999 13.2 C 17.453333 11.973333 16.946667 10.873333 16.199999 9.9 C 15.453332 8.926666 14.539999 8.166667 13.46 7.62 C 12.379999 7.073334 11.226666 6.8 10 6.799999 C 9.146667 6.8 8.32 6.933333 7.52 7.2 Z " />
</MenuItem.Icon>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="False">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsConcealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsRevealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</ConditionAction>
</DataTriggerBehavior>
</Interaction.Behaviors>
</MenuItem>
<MenuItem
Width="216"
Classes="Hide"
Command="{Binding CopyCommand}"
Header="Copy">
<MenuItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 8 3.799999 C 7.44 3.799999 6.966666 3.993334 6.58 4.379999 C 6.193333 4.766666 6 5.24 6 5.799999 L 6 15.799999 C 6 16.360001 6.193333 16.833332 6.58 17.219999 C 6.966666 17.606667 7.44 17.799999 8 17.799999 L 14 17.799999 C 14.559999 17.799999 15.033333 17.606667 15.42 17.219999 C 15.806666 16.833332 16 16.360001 16 15.799999 L 16 5.799999 C 16 5.24 15.806666 4.766666 15.42 4.379999 C 15.033333 3.993334 14.559999 3.799999 14 3.799999 Z M 7 5.799999 C 7 5.533333 7.1 5.299999 7.3 5.1 C 7.5 4.9 7.733333 4.799999 8 4.799999 L 14 4.799999 C 14.266666 4.799999 14.5 4.9 14.7 5.1 C 14.9 5.299999 14.999999 5.533333 15 5.799999 L 15 15.799999 C 14.999999 16.066666 14.9 16.299999 14.7 16.5 C 14.5 16.700001 14.266666 16.799999 14 16.799999 L 8 16.799999 C 7.733333 16.799999 7.5 16.700001 7.3 16.5 C 7.1 16.299999 7 16.066666 7 15.799999 Z M 4 7.799999 C 4 7.453333 4.086667 7.12 4.26 6.799999 C 4.433333 6.48 4.68 6.240001 5 6.08 L 5 16.279999 C 5 16.973333 5.246666 17.566666 5.74 18.059999 C 6.233333 18.553333 6.813333 18.799999 7.48 18.799999 L 13.719999 18.799999 C 13.559999 19.119999 13.32 19.366667 13 19.539999 C 12.679998 19.713333 12.346665 19.799999 12 19.799999 L 7.52 19.799999 C 6.533333 19.799999 5.7 19.459999 5.02 18.779999 C 4.34 18.099998 4 17.266666 4 16.279999 Z " />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Button.Flyout>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</Button>
</DataTriggerBehavior>
</Interaction.Behaviors>
</MenuItem>
<MenuItem
Width="216"
Classes="Hide"
Command="{Binding HideCommand}"
Header="Hide">
<MenuItem.Styles>
<Style Selector="MenuItem.Hide">
<Setter Property="IsVisible" Value="False" />
</Style>
<Style Selector="MenuItem.Show">
<Setter Property="IsVisible" Value="True" />
</Style>
</MenuItem.Styles>
<MenuItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 2.84 3.959999 C 2.76 3.853333 2.646667 3.799999 2.5 3.799999 C 2.353333 3.799999 2.233333 3.846668 2.14 3.940001 C 2.046667 4.033333 2 4.153334 2 4.299999 C 2 4.446667 2.053333 4.560001 2.16 4.639999 L 5.64 8.16 C 4.786666 8.746668 4.066667 9.473333 3.48 10.339999 C 2.893333 11.206667 2.493333 12.16 2.28 13.2 C 2.253333 13.386666 2.306667 13.546666 2.44 13.679999 C 2.573333 13.813334 2.733333 13.846666 2.92 13.78 C 3.106666 13.713333 3.213333 13.586666 3.24 13.4 C 3.453333 12.466666 3.826667 11.606667 4.36 10.82 C 4.893333 10.033334 5.559999 9.386667 6.36 8.879999 L 7.96 10.44 C 7.4 10.866667 6.993333 11.4 6.74 12.039999 C 6.486666 12.679999 6.426666 13.34 6.56 14.02 C 6.693333 14.7 7.006666 15.286667 7.5 15.779999 C 7.993333 16.273333 8.58 16.586666 9.26 16.719999 C 9.94 16.853333 10.606666 16.799999 11.259999 16.559999 C 11.913332 16.32 12.439999 15.906666 12.84 15.32 L 17.16 19.639999 C 17.239998 19.746666 17.353333 19.799999 17.5 19.799999 C 17.646666 19.799999 17.766666 19.753332 17.859999 19.66 C 17.953331 19.566666 18 19.446667 18 19.299999 C 18 19.153332 17.946667 19.039999 17.84 18.959999 Z M 10.12 9.799999 L 13.48 13.16 C 13.453333 12.253333 13.113333 11.473333 12.46 10.82 C 11.806666 10.166666 11.026667 9.826666 10.12 9.799999 Z M 7.52 7.2 L 8.32 8 C 8.879999 7.866667 9.44 7.799999 10 7.799999 C 11.066666 7.799999 12.073333 8.039999 13.02 8.52 C 13.966666 9 14.766666 9.666667 15.42 10.52 C 16.073334 11.373333 16.52 12.333333 16.76 13.4 C 16.786667 13.533333 16.853333 13.639999 16.959999 13.719999 C 17.066666 13.799999 17.186665 13.826666 17.32 13.799999 C 17.453333 13.773333 17.559999 13.699999 17.639999 13.579999 C 17.719999 13.459999 17.746666 13.333333 17.719999 13.2 C 17.453333 11.973333 16.946667 10.873333 16.199999 9.9 C 15.453332 8.926666 14.539999 8.166667 13.46 7.62 C 12.379999 7.073334 11.226666 6.8 10 6.799999 C 9.146667 6.8 8.32 6.933333 7.52 7.2 Z " />
</MenuItem.Icon>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsRevealed}" Value="False">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsConcealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</ConditionAction>
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding IsConcealed}" Value="True">
<ConditionAction>
<ConditionAction.Condition>
<ConditionalExpression ForwardChaining="And">
<ComparisonCondition LeftOperand="{Binding IsRevealed}" RightOperand="True" />
</ConditionalExpression>
</ConditionAction.Condition>
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</ConditionAction>
</DataTriggerBehavior>
</Interaction.Behaviors>
</MenuItem>
<MenuItem
Width="216"
Classes="Hide"
Command="{Binding CopyCommand}"
Header="Copy">
<MenuItem.Icon>
<PathIcon
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="F1 M 8 3.799999 C 7.44 3.799999 6.966666 3.993334 6.58 4.379999 C 6.193333 4.766666 6 5.24 6 5.799999 L 6 15.799999 C 6 16.360001 6.193333 16.833332 6.58 17.219999 C 6.966666 17.606667 7.44 17.799999 8 17.799999 L 14 17.799999 C 14.559999 17.799999 15.033333 17.606667 15.42 17.219999 C 15.806666 16.833332 16 16.360001 16 15.799999 L 16 5.799999 C 16 5.24 15.806666 4.766666 15.42 4.379999 C 15.033333 3.993334 14.559999 3.799999 14 3.799999 Z M 7 5.799999 C 7 5.533333 7.1 5.299999 7.3 5.1 C 7.5 4.9 7.733333 4.799999 8 4.799999 L 14 4.799999 C 14.266666 4.799999 14.5 4.9 14.7 5.1 C 14.9 5.299999 14.999999 5.533333 15 5.799999 L 15 15.799999 C 14.999999 16.066666 14.9 16.299999 14.7 16.5 C 14.5 16.700001 14.266666 16.799999 14 16.799999 L 8 16.799999 C 7.733333 16.799999 7.5 16.700001 7.3 16.5 C 7.1 16.299999 7 16.066666 7 15.799999 Z M 4 7.799999 C 4 7.453333 4.086667 7.12 4.26 6.799999 C 4.433333 6.48 4.68 6.240001 5 6.08 L 5 16.279999 C 5 16.973333 5.246666 17.566666 5.74 18.059999 C 6.233333 18.553333 6.813333 18.799999 7.48 18.799999 L 13.719999 18.799999 C 13.559999 19.119999 13.32 19.366667 13 19.539999 C 12.679998 19.713333 12.346665 19.799999 12 19.799999 L 7.52 19.799999 C 6.533333 19.799999 5.7 19.459999 5.02 18.779999 C 4.34 18.099998 4 17.266666 4 16.279999 Z " />
</MenuItem.Icon>
</MenuItem>
</MenuFlyout>
</Button.Flyout>
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
<AddClassAction ClassName="Show" RemoveIfExists="True" />
<RemoveClassAction ClassName="Hide" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<AddClassAction ClassName="Hide" RemoveIfExists="True" />
<RemoveClassAction ClassName="Show" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</Button>
</StackPanel>
</UserControl>
+1 -1
View File
@@ -21,7 +21,7 @@
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
<Thickness x:Key="TextControlMargin">0</Thickness>
<Thickness x:Key="TextControlPadding">10,5,6,6</Thickness>
<Thickness x:Key="TextControlPadding">10,6,6,5</Thickness>
<Thickness x:Key="TextControlCompactPadding">0</Thickness>
<Thickness x:Key="TextControlCompactMargin">0</Thickness>
<BooleanToPasswordCharConverter x:Key="BooleanToPasswordCharConverter" PasswordChar="&#x25CF;" />
+1 -3
View File
@@ -24,9 +24,7 @@
<Thickness x:Key="TextControlCompactPadding">0</Thickness>
<Thickness x:Key="TextControlCompactMargin">0</Thickness>
</SettingsExpander.Resources>
<SettingsExpander.Icon>
<DeleteItemEntryView />
</SettingsExpander.Icon>
<SettingsExpander.Icon />
<SettingsExpander.Action>
<ItemEntryActionView />
</SettingsExpander.Action>
@@ -1,4 +1,5 @@
using System.Reflection;
using System.Reactive.Disposables;
using System.Reflection;
using Toolkit.Foundation;
namespace Wallet;
@@ -7,6 +8,7 @@ public class ItemContentViewModelActivationHandler(IDecoratorService<Item<(Guid,
IDecoratorService<ItemConfiguration> itemConfigurationDecorator,
IMediator mediator,
IServiceFactory serviceFactory,
IDisposer disposer,
IPublisher publisher) :
INotificationHandler<ActivationEventArgs<ItemSectionViewModel>>
{
@@ -39,6 +41,12 @@ public class ItemContentViewModelActivationHandler(IDecoratorService<Item<(Guid,
if (await mediator.Handle<object, IItemEntryViewModel?>(message,
entryConfiguration.GetType().Name) is IItemEntryViewModel entryViewModel)
{
// Should this be here?
disposer.Add(entryViewModel, Disposable.Create(() =>
{
configurationSection.Entries.Remove(entryConfiguration);
}));
publisher.Publish(Create.As(entryViewModel), id);
}
}
+6
View File
@@ -7,6 +7,7 @@ namespace Wallet;
public partial class ItemEntryViewModel<TValue> :
Observable<string, TValue>,
IItemEntryViewModel,
IRemovable,
IHandler<ValidateEventArgs<ItemEntry>, bool>,
INotificationHandler<ConfirmEventArgs<ItemEntry>>,
INotificationHandler<UpdateEventArgs<ItemEntry>>,
@@ -69,6 +70,8 @@ public partial class ItemEntryViewModel<TValue> :
return Task.CompletedTask;
}
public async Task<bool> Handle(ValidateEventArgs<ItemEntry> args,
CancellationToken cancellationToken)
{
@@ -80,6 +83,9 @@ public partial class ItemEntryViewModel<TValue> :
return await Task.FromResult(true);
}
[RelayCommand]
private void Remove() => Dispose();
[RelayCommand]
private void Copy() => Publisher.Publish(Write.As(new Clipboard<object>($"{Value}")));