WIP
This commit is contained in:
@@ -177,10 +177,14 @@ public partial class App : Application
|
||||
services.AddTemplate<ItemSectionViewModel, ItemSectionView>();
|
||||
|
||||
services.AddTemplate<TextEntryViewModel, TextEntryView>();
|
||||
services.AddTemplate<MultilineTextEntryViewModel, MultilineTextEntryView>();
|
||||
|
||||
services.AddTemplate<CreateCommentEntryViewModel, CreateCommentEntryView>();
|
||||
services.AddTemplate<CommentEntryViewModel, CommentEntryView>();
|
||||
services.AddTemplate<CommentEntryCollectionViewModel, CommentEntryCollectionView>();
|
||||
|
||||
services.AddTemplate<PasswordEntryViewModel, PasswordEntryView>();
|
||||
services.AddTemplate<MaskedTextEntryViewModel, MaskedTextEntryView>();
|
||||
services.AddTemplate<DropdownEntryViewModel, DropdownEntryView>();
|
||||
services.AddTemplate<DropdownEntryCollectionViewModel, DropdownEntryCollectionView>();
|
||||
services.AddTemplate<DateEntryViewModel, DateEntryView>();
|
||||
services.AddTemplate<HyperlinkEntryViewModel, HyperlinkEntryView>();
|
||||
services.AddTemplate<PinEntryViewModel, PinEntryView>();
|
||||
@@ -209,10 +213,10 @@ public partial class App : Application
|
||||
services.AddHandler<UnfavouriteItemHandler>();
|
||||
|
||||
services.AddHandler<TextEntryViewModelHandler>(nameof(TextEntryConfiguration));
|
||||
services.AddHandler<MultilineTextEntryViewModelHandler>(nameof(MultilineTextEntryConfiguration));
|
||||
services.AddHandler<CommentEntryCollectionViewModelHandler>(nameof(CommentEntryCollectionConfiguration));
|
||||
services.AddHandler<PasswordEntryViewModelHandler>(nameof(PasswordEntryConfiguration));
|
||||
services.AddHandler<MaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
|
||||
services.AddHandler<DropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
|
||||
services.AddHandler<DropdownEntryCollectionViewModelHandler>(nameof(DropdownEntryCollectionConfiguration));
|
||||
services.AddHandler<DateEntryViewModelHandler>(nameof(DateEntryConfiguration));
|
||||
services.AddHandler<HyperlinkEntryViewModelHandler>(nameof(HyperlinkEntryConfiguration));
|
||||
services.AddHandler<PinEntryViewModelHandler>(nameof(PinEntryConfiguration));
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.CommentEntryCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:CommentEntryCollectionViewModel"
|
||||
Header="{Binding Key}"
|
||||
IsExpanded="True"
|
||||
ItemTemplate="{ReflectionBinding Template}"
|
||||
ItemsSource="{Binding}" />
|
||||
+2
-2
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class MultilineTextEntryView :
|
||||
public partial class CommentEntryCollectionView :
|
||||
SettingsExpander
|
||||
{
|
||||
public MultilineTextEntryView() =>
|
||||
public CommentEntryCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
<SettingsExpanderItem
|
||||
x:Class="Wallet.Avalonia.CommentEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:CommentEntryViewModel"
|
||||
Content="{Binding Value}"
|
||||
Description="{Binding Key}" />
|
||||
@@ -0,0 +1,11 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia
|
||||
{
|
||||
public partial class CommentEntryView :
|
||||
SettingsExpanderItem
|
||||
{
|
||||
public CommentEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
<SettingsExpanderItem
|
||||
x:Class="Wallet.Avalonia.CreateCommentEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:CreateCommentEntryViewModel">
|
||||
<SettingsExpanderItem.Resources>
|
||||
<ControlTheme x:Key="TextBoxAddButtonStyle" TargetType="Button">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForeground}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
<Setter Property="Template">
|
||||
<ControlTemplate>
|
||||
<Border
|
||||
Name="ButtonLayoutGrid"
|
||||
Margin="{DynamicResource TextBoxInnerButtonMargin}"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<SymbolIcon
|
||||
Name="Glyph"
|
||||
HorizontalAlignment="Center"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="{StaticResource TextBoxIconFontSize}"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Symbol="Add" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Style Selector="^ /template/ Border#ButtonLayoutGrid">
|
||||
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPointerOver}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPointerOver}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ SymbolIcon#Glyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPointerOver}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:pressed">
|
||||
<Style Selector="^ /template/ Border#ButtonLayoutGrid">
|
||||
<Setter Property="Background" Value="{DynamicResource TextControlButtonBackgroundPressed}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource TextControlButtonBorderBrushPressed}" />
|
||||
</Style>
|
||||
|
||||
<Style Selector="^ /template/ SymbolIcon#Glyph">
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextControlButtonForegroundPressed}" />
|
||||
</Style>
|
||||
</Style>
|
||||
|
||||
<Style Selector="^:disabled /template/ Border#ButtonLayoutGrid">
|
||||
<Setter Property="Opacity" Value="0" />
|
||||
</Style>
|
||||
</ControlTheme>
|
||||
|
||||
</SettingsExpanderItem.Resources>
|
||||
<TextBox
|
||||
MaxHeight="216"
|
||||
AcceptsReturn="True"
|
||||
Text="{Binding Value}"
|
||||
TextWrapping="Wrap"
|
||||
Watermark="Add a note">
|
||||
<TextBox.InnerRightContent>
|
||||
<Button
|
||||
Width="30"
|
||||
Padding="{StaticResource HelperButtonThemePadding}"
|
||||
VerticalAlignment="Stretch"
|
||||
Command="{Binding InvokeCommand}"
|
||||
Content="Add"
|
||||
CornerRadius="{DynamicResource ControlCornerRadius}"
|
||||
Focusable="False"
|
||||
IsTabStop="False"
|
||||
Theme="{StaticResource TextBoxAddButtonStyle}" />
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
</SettingsExpanderItem>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CreateCommentEntryView :
|
||||
SettingsExpanderItem
|
||||
{
|
||||
public CreateCommentEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.DropdownEntryView"
|
||||
x:Class="Wallet.Avalonia.DropdownEntryCollectionView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:DropdownEntryViewModel"
|
||||
x:DataType="vm:DropdownEntryCollectionViewModel"
|
||||
Header="{Binding Key}"
|
||||
IsExpanded="False">
|
||||
<SettingsExpander.Resources>
|
||||
+2
-2
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class DropdownEntryView :
|
||||
public partial class DropdownEntryCollectionView :
|
||||
SettingsExpander
|
||||
{
|
||||
public DropdownEntryView() =>
|
||||
public DropdownEntryCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.MultilineTextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:MultilineTextEntryViewModel"
|
||||
Header="{Binding Key}"
|
||||
IsExpanded="True"
|
||||
IsToggleable="True">
|
||||
<TextBox
|
||||
Text="{Binding Value}"
|
||||
TextWrapping="Wrap"
|
||||
Watermark="Add a note">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MaxHeight" Value="216" />
|
||||
<Setter Property="AcceptsTab" Value="True" />
|
||||
<Setter Property="AcceptsReturn" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<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>
|
||||
@@ -74,8 +74,8 @@
|
||||
<Compile Update="DismissItemActionView.axaml.cs">
|
||||
<DependentUpon>DismissItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="DropdownEntryView.axaml.cs">
|
||||
<DependentUpon>DropdownEntryView.axaml</DependentUpon>
|
||||
<Compile Update="DropdownEntryCollectionView.axaml.cs">
|
||||
<DependentUpon>DropdownEntryCollectionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemHeaderView.axaml.cs">
|
||||
<DependentUpon>ItemHeaderView.axaml</DependentUpon>
|
||||
@@ -86,6 +86,9 @@
|
||||
<Compile Update="FavouritesNavigationView.axaml.cs">
|
||||
<DependentUpon>FavouritesNavigationView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="CommentEntryCollectionView.axaml.cs">
|
||||
<DependentUpon>CommentEntryCollectionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TextEntryView.axaml.cs">
|
||||
<DependentUpon>TextEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
Reference in New Issue
Block a user