It it now possible to create/edit item contents

This commit is contained in:
TheXamlGuy
2024-06-06 20:42:23 +01:00
parent 1302145f1c
commit c399e8c05c
30 changed files with 331 additions and 180 deletions
+2 -1
View File
@@ -87,11 +87,12 @@ public partial class App : Application
if (provider.GetRequiredService<IDecoratorService<LockerConnection>>()
is IDecoratorService<LockerConnection> connection)
{
args.UseSqlite($"{connection.Value}");
args.UseSqlite($"{connection.Service}");
}
});
services.AddHandler<QueryLockerHandler>();
services.AddHandler<RequestItemHandler>();
services.AddHandler<CreateItemHandler>();
services.AddHandler<UpdateItemHander>();
services.AddHandler<UpdateItemStateHandler>();
+2 -25
View File
@@ -17,36 +17,13 @@
<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.Write}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
</Interaction.Behaviors>
<TextBox.Styles>
<Style Selector="TextBox.Read">
<Setter Property="IsReadOnly" Value="True" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Style Selector="^:pointerover">
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundPointerOver}" />
<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
</Style>
</Style>
<Style Selector="^:focus">
<Setter Property="Foreground" Value="{DynamicResource TextControlForegroundFocused}" />
<Style Selector="^ /template/ TextBlock#PART_Watermark">
<Setter Property="Foreground" Value="{DynamicResource TextControlPlaceholderForegroundFocused}" />
</Style>
<Style Selector="^ /template/ Border#PART_BorderElement">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
</Style>
</Style>
</Style>
<Style Selector="TextBox.Write" />
</TextBox.Styles>
</TextBox>
</StackPanel>
</UserControl>
@@ -6,6 +6,17 @@
x:DataType="vm:ItemMaskedTextEntryViewModel"
Header="{Binding Key}">
<SettingsExpander.Footer>
<TextBox MinWidth="264" Text="{Binding Value}" />
<TextBox HorizontalAlignment="Right" Text="{Binding Value}">
<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.Write}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</TextBox>
</SettingsExpander.Footer>
</SettingsExpander>
+10 -1
View File
@@ -10,6 +10,15 @@
MinWidth="264"
Classes="revealPasswordButton"
PasswordChar="&#x25CF;"
Text="{Binding Value}" />
Text="{Binding Value}">
<Interaction.Behaviors>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
<AddClassAction ClassName="Read" RemoveIfExists="True" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</TextBox>
</SettingsExpander.Footer>
</SettingsExpander>
+12 -1
View File
@@ -6,6 +6,17 @@
x:DataType="vm:ItemTextEntryViewModel"
Header="{Binding Key}">
<SettingsExpander.Footer>
<TextBox MinWidth="264" Text="{Binding Value}" />
<TextBox HorizontalAlignment="Right" Text="{Binding Value}">
<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.Write}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</TextBox>
</SettingsExpander.Footer>
</SettingsExpander>
+39 -1
View File
@@ -4,6 +4,44 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:ItemViewModel">
<UserControl.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>
</UserControl.Styles>
<Interaction.Behaviors>
<AttachedBehaviour>
<NavigateAction
@@ -22,7 +60,7 @@
</ConditionalExpression>
</ConditionAction.Condition>
<NavigateBackAction Region="Left" />
</ConditionAction>
</ConditionAction>
</DataTriggerBehavior>
</Interaction.Behaviors>
<ScrollViewer Padding="12,12,12,0">