Implement read only mode
MODIFY
WalletWasabi.Fluent/App.axaml
WalletWasabi.Fluent/App.axaml
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/Dialog.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/ProgressRingArc.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/ProgressRing.axaml" />
- <StyleInclude Source="avares://WalletWasabi.Fluent/Controls/TagsControl.axaml" />
+ <StyleInclude Source="avares://WalletWasabi.Fluent/Controls/TagControl.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/TagsBox.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/NavBarItem.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/NavBarTreeItem.axaml" />

RENAME
WalletWasabi.Fluent/Controls/TagsControl.axaml
WalletWasabi.Fluent/Controls/TagControl.axaml
</Setter>
</Style>
- <Style Selector="c|TagControl">
+ <Style Selector="c|TagsBox c|TagControl /template/ Panel#PART_TagPanel LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
+ <Setter Property="LayoutTransform" Value="scaleX(0)" />
+ </Style>
+
+ <Style Selector="c|TagsBox c|TagControl /template/ Panel#PART_TagPanel Button#PART_DeleteButton">
+ <Setter Property="Opacity" Value="0" />
+ </Style>
+
+ <Style Selector="c|TagsBox:not(:readonly) c|TagControl /template/ Panel#PART_TagPanel:pointerover LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
+ <Setter Property="LayoutTransform" Value="scaleX(1)" />
+ </Style>
+
+ <Style Selector="c|TagsBox:not(:readonly) c|TagControl /template/ Panel#PART_TagPanel:pointerover Button#PART_DeleteButton">
+ <Setter Property="Opacity" Value="1" />
+ </Style>
+
+ <Style Selector="c|TagsBox c|TagControl">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextControlBorderBrush}" />
<ControlTemplate>
<Panel>
<Panel.Styles>
- <Style Selector="Panel#PART_TagPanel LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
- <Setter Property="LayoutTransform" Value="scaleX(0)" />
- </Style>
- <Style
- Selector="Panel#PART_TagPanel:pointerover LayoutTransformControl#PART_DeleteButtonLayoutTransformer">
- <Setter Property="LayoutTransform" Value="scaleX(1)" />
- </Style>
- <Style Selector="Panel#PART_TagPanel Button#PART_DeleteButton">
- <Setter Property="Opacity" Value="0" />
- </Style>
- <Style Selector="Panel#PART_TagPanel:pointerover Button#PART_DeleteButton">
- <Setter Property="Opacity" Value="1" />
- </Style>
</Panel.Styles>
<Panel Name="PART_TagPanel">
<Border Name="PART_TagItemBorder"

RENAME
WalletWasabi.Fluent/Controls/TagsControl.axaml.cs
WalletWasabi.Fluent/Controls/TagControl.axaml.cs
MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml
WalletWasabi.Fluent/Controls/TagsBox.axaml
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:c="using:WalletWasabi.Fluent.Controls">
+ <Styles.Resources>
+ <Thickness x:Key="TagsBoxBorderPadding">4,4,0,0</Thickness>
+ </Styles.Resources>
<Style Selector="c|TagsBox">
<Setter Property="Foreground" Value="{DynamicResource TextControlForeground}" />
<Setter Property="Background" Value="{DynamicResource TextControlBackground}" />
<Setter Property="Cursor" Value="IBeam" />
<Setter Property="Template">
<ControlTemplate>
- <!-- <DataValidationErrors> -->
+ <DataValidationErrors>
<Border x:Name="PART_Border" Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
</ItemsPresenter.ItemsPanel>
</ItemsPresenter>
</Border>
- <!-- </DataValidationErrors> -->
+ </DataValidationErrors>
</ControlTemplate>
</Setter>
<Setter Property="(ScrollViewer.HorizontalScrollBarVisibility)" Value="Disabled" />
<Setter Property="BorderBrush" Value="{DynamicResource SystemControlErrorTextForegroundBrush}" />
</Style>
+ <Style Selector="c|TagsBox:readonly /template/ Border#PART_Border">
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="BorderBrush" Value="Transparent" />
+ </Style>
+
+ <Style Selector="c|TagsBox:readonly AutoCompleteBox">
+ <Setter Property="IsVisible" Value="False" />
+ </Style>
+
+ <Style Selector="c|TagsBox:readonly">
+ <Setter Property="Cursor" Value="Arrow" />
+ </Style>
+
<Style Selector="c|TagsBox c|TagControl">
<Setter Property="Margin" Value="0,0,4,4" />
</Style>
</ContextMenu>
</Setter>
</Style>
+
+
</Styles>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
WalletWasabi.Fluent/Controls/TagsBox.axaml.cs
@@ -50,7 +50,8 @@ namespace WalletWasabi.Fluent.Controls
o => o.CompletedCommand,
(o, v) => o.CompletedCommand = v);
- public static readonly StyledProperty<bool> IsReadOnlyProperty = AvaloniaProperty.Register<TagsBox, bool>("IsReadOnly");
+ public static readonly StyledProperty<bool> IsReadOnlyProperty =
+ AvaloniaProperty.Register<TagsBox, bool>("IsReadOnly");
static TagsBox()
{
@@ -355,6 +356,15 @@ namespace WalletWasabi.Fluent.Controls
CheckIsInputEnabled();
}
+ protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> e)
+ {
+ base.OnPropertyChanged(e);
+
+ if (e.Property == IsReadOnlyProperty)
+ {
+ PseudoClasses.Set(":readonly", IsReadOnly);
+ }
+ }
internal void RemoveTargetTag(object? tag)
{

MODIFY
WalletWasabi.Fluent/Styles/Themes/Base.axaml
WalletWasabi.Fluent/Styles/Themes/Base.axaml
<SolidColorBrush x:Key="WarningMessageForeground">#FFDD00</SolidColorBrush>
<StaticResource x:Key="SystemControlErrorTextForegroundBrush" ResourceKey="SystemErrorTextColor" />
<SolidColorBrush x:Key="HyperLinkForeground">#00A2E8</SolidColorBrush>
- <Thickness x:Key="TagsBoxBorderPadding">4,4,0,0</Thickness>
</Styles.Resources>
</Styles>

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/RecoverWalletViewModel.cs
@@ -137,8 +137,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
private Interaction<(KeyPath, int), (KeyPath?, int?)> AdvancedOptionsInteraction { get; }
- public ObservableCollection<RecoveryWordIndexed> Mnemonics { get; } =
- new ObservableCollection<RecoveryWordIndexed>() { new RecoveryWordIndexed(0, "maximum")};
+ public ObservableCollection<RecoveryWordIndexed> Mnemonics { get; } = new();
private void ValidateMnemonics(IValidationErrors errors)
{

MODIFY
WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml
WalletWasabi.Fluent/Views/AddWallet/RecoverWalletView.axaml
<c:TagsBox x:Name="SeedTagsBox"
DockPanel.Dock="Top"
ItemCountLimit="12"
- IsReadOnly="False"
RestrictInputToSuggestions="True"
Items="{Binding Mnemonics}"
Suggestions="{Binding Suggestions}"

Implement read only mode