Added MultilineTextEntryView

This commit is contained in:
TheXamlGuy
2024-06-08 21:24:59 +01:00
parent 9a664b583b
commit f64453232b
30 changed files with 185 additions and 96 deletions
+10 -8
View File
@@ -154,10 +154,11 @@ public partial class App : Application
services.AddTemplate<ItemSectionViewModel, ItemSectionView>();
services.AddTemplate<ItemTextEntryViewModel, ItemTextEntryView>();
services.AddTemplate<ItemPasswordEntryViewModel, ItemPasswordEntryView>();
services.AddTemplate<ItemMaskedTextEntryViewModel, ItemMaskedTextEntryView>();
services.AddTemplate<ItemDropdownEntryViewModel, ItemDropdownEntryView>();
services.AddTemplate<TextEntryViewModel, TextEntryView>();
services.AddTemplate<MultilineTextEntryViewModel, MultilineTextEntryView>();
services.AddTemplate<PasswordEntryViewModel, PasswordEntryView>();
services.AddTemplate<MaskedTextEntryViewModel, MaskedTextEntryView>();
services.AddTemplate<DropdownEntryViewModel, DropdownEntryView>();
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
@@ -177,10 +178,11 @@ public partial class App : Application
services.AddHandler<FavouriteItemHandler>();
services.AddHandler<UnfavouriteItemHandler>();
services.AddHandler<ItemTextEntryViewModelHandler>(nameof(TextEntryConfiguration));
services.AddHandler<ItemPasswordEntryViewModelHandler>(nameof(PasswordEntryConfiguration));
services.AddHandler<ItemMaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
services.AddHandler<ItemDropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
services.AddHandler<TextEntryViewModelHandler>(nameof(TextEntryConfiguration));
services.AddHandler<MultilineTextEntryViewModelHandler>(nameof(MultilineTextEntryConfiguration));
services.AddHandler<PasswordEntryViewModelHandler>(nameof(PasswordEntryConfiguration));
services.AddHandler<MaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
services.AddHandler<DropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
services.AddHandler<ItemCreatedHandler>(ServiceLifetime.Singleton);
services.AddHandler<ItemModifiedHandler>(ServiceLifetime.Singleton);
@@ -67,12 +67,24 @@
<Compile Update="DismissItemActionView.axaml.cs">
<DependentUpon>DismissItemActionView.axaml</DependentUpon>
</Compile>
<Compile Update="DropdownEntryView.axaml.cs">
<DependentUpon>DropdownEntryView.axaml</DependentUpon>
</Compile>
<Compile Update="ItemHeaderView.axaml.cs">
<DependentUpon>ItemHeaderView.axaml</DependentUpon>
</Compile>
<Compile Update="ItemContentView.axaml.cs">
<DependentUpon>ItemContentView.axaml</DependentUpon>
</Compile>
<Compile Update="TextEntryView.axaml.cs">
<DependentUpon>TextEntryView.axaml</DependentUpon>
</Compile>
<Compile Update="PasswordEntryView.axaml.cs">
<DependentUpon>PasswordEntryView.axaml</DependentUpon>
</Compile>
<Compile Update="MaskedTextEntryView.axaml.cs">
<DependentUpon>MaskedTextEntryView.axaml</DependentUpon>
</Compile>
<Compile Update="OpenLockerView.axaml.cs">
<DependentUpon>OpenLockerView.axaml</DependentUpon>
</Compile>
@@ -1,9 +1,9 @@
<SettingsExpander
x:Class="Bitvault.Avalonia.ItemDropdownEntryView"
x:Class="Bitvault.Avalonia.DropdownEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:ItemDropdownEntryViewModel"
x:DataType="vm:DropdownEntryViewModel"
Header="{Binding Key}">
<SettingsExpander.Footer>
<Grid>
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
namespace Bitvault.Avalonia;
public partial class ItemTextEntryView :
public partial class DropdownEntryView :
SettingsExpander
{
public ItemTextEntryView() =>
public DropdownEntryView() =>
InitializeComponent();
}
@@ -1,9 +1,9 @@
<SettingsExpander
x:Class="Bitvault.Avalonia.ItemMaskedTextEntryView"
x:Class="Bitvault.Avalonia.MaskedTextEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:ItemMaskedTextEntryViewModel"
x:DataType="vm:MaskedTextEntryViewModel"
Header="{Binding Key}">
<SettingsExpander.Footer>
<MaskedTextBox Mask="{Binding Pattern}" Text="{Binding Value}">
@@ -2,10 +2,10 @@ using Toolkit.UI.Controls.Avalonia;
namespace Bitvault.Avalonia
{
public partial class ItemMaskedTextEntryView :
public partial class MaskedTextEntryView :
SettingsExpander
{
public ItemMaskedTextEntryView() =>
public MaskedTextEntryView() =>
InitializeComponent();
}
}
@@ -0,0 +1,64 @@
<SettingsExpander
x:Class="Bitvault.Avalonia.MultilineTextEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:MultilineTextEntryViewModel"
Header="{Binding Key}">
<TextBox Text="{Binding Value}" TextWrapping="Wrap">
<TextBox.Styles>
<Style Selector="TextBox.Write">
<Setter Property="Height" Value="216" />
<Setter Property="AcceptsTab" Value="True" />
<Setter Property="AcceptsReturn" Value="True" />
</Style>
<Style Selector="TextBox.Read">
<Setter Property="Height" Value="216" />
<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>
</TextBox.Styles>
<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.New}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
<AddClassAction ClassName="Write" RemoveIfExists="True" />
<RemoveClassAction ClassName="Read" />
</DataTriggerBehavior>
</Interaction.Behaviors>
</TextBox>
</SettingsExpander>
@@ -0,0 +1,10 @@
using Toolkit.UI.Controls.Avalonia;
namespace Bitvault.Avalonia;
public partial class MultilineTextEntryView :
SettingsExpander
{
public MultilineTextEntryView() =>
InitializeComponent();
}
@@ -1,9 +1,9 @@
<SettingsExpander
x:Class="Bitvault.Avalonia.ItemPasswordEntryView"
x:Class="Bitvault.Avalonia.PasswordEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:ItemPasswordEntryViewModel"
x:DataType="vm:PasswordEntryViewModel"
Header="{Binding Key}">
<SettingsExpander.Footer>
<TextBox
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
namespace Bitvault.Avalonia;
public partial class ItemPasswordEntryView :
public partial class PasswordEntryView :
SettingsExpander
{
public ItemPasswordEntryView() =>
public PasswordEntryView() =>
InitializeComponent();
}
@@ -1,9 +1,9 @@
<SettingsExpander
x:Class="Bitvault.Avalonia.ItemTextEntryView"
x:Class="Bitvault.Avalonia.TextEntryView"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:Bitvault"
x:DataType="vm:ItemTextEntryViewModel"
x:DataType="vm:TextEntryViewModel"
Header="{Binding Key}">
<SettingsExpander.Footer>
<TextBox Text="{Binding Value}">
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
namespace Bitvault.Avalonia;
public partial class ItemDropdownEntryView :
public partial class TextEntryView :
SettingsExpander
{
public ItemDropdownEntryView() =>
public TextEntryView() =>
InitializeComponent();
}