Added HyperlinkEntry
This commit is contained in:
@@ -166,6 +166,7 @@ public partial class App : Application
|
||||
services.AddTemplate<MaskedTextEntryViewModel, MaskedTextEntryView>();
|
||||
services.AddTemplate<DropdownEntryViewModel, DropdownEntryView>();
|
||||
services.AddTemplate<DateEntryViewModel, DateEntryView>();
|
||||
services.AddTemplate<HyperlinkEntryViewModel, HyperlinkEntryView>();
|
||||
|
||||
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
|
||||
|
||||
@@ -180,6 +181,8 @@ public partial class App : Application
|
||||
services.AddHandler<ConfirmUpdateItemHandler>(nameof(ItemState.Write));
|
||||
services.AddHandler<ConfirmCreateItemHandler>(nameof(ItemState.New));
|
||||
|
||||
services.AddHandler<HyperlinkHandler>();
|
||||
|
||||
services.AddHandler<ArchiveItemHandler>();
|
||||
services.AddHandler<UnarchiveItemHandler>();
|
||||
services.AddHandler<FavouriteItemHandler>();
|
||||
@@ -191,7 +194,8 @@ public partial class App : Application
|
||||
services.AddHandler<MaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
|
||||
services.AddHandler<DropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
|
||||
services.AddHandler<DateEntryViewModelHandler>(nameof(DateEntryConfiguration));
|
||||
|
||||
services.AddHandler<HyperlinkEntryViewModelHandler>(nameof(HyperlinkEntryConfiguration));
|
||||
|
||||
services.AddHandler<ItemCreatedHandler>(ServiceLifetime.Singleton);
|
||||
services.AddHandler<ItemModifiedHandler>(ServiceLifetime.Singleton);
|
||||
});
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<SettingsExpander
|
||||
x:Class="Wallet.Avalonia.HyperlinkEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Wallet"
|
||||
x:DataType="vm:HyperlinkEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<Grid>
|
||||
<TextBox Text="{Binding Value}">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="MinWidth" Value="{Binding Width}" />
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</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>
|
||||
<HyperlinkButton Command="{Binding InvokeCommand}" Content="{Binding Value}">
|
||||
<HyperlinkButton.Styles>
|
||||
<Style Selector="HyperlinkButton.Write">
|
||||
<Setter Property="IsVisible" Value="False" />
|
||||
</Style>
|
||||
<Style Selector="HyperlinkButton.Read">
|
||||
<Setter Property="IsVisible" Value="True" />
|
||||
</Style>
|
||||
</HyperlinkButton.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>
|
||||
</HyperlinkButton>
|
||||
</Grid>
|
||||
</SettingsExpander.Footer>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class HyperlinkEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public HyperlinkEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
Reference in New Issue
Block a user