Fix PrivacyText
MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml
<PathIcon Data="{StaticResource incognito_pathicon}" />
</Viewbox>
<TextBlock Name="PART_PrivacyText"
- Text="{TemplateBinding PrivacyText}" />
+ Text="{Binding PrivacyText^, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</Panel>
</Panel>
</ControlTemplate>

MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
@@ -20,9 +20,6 @@ public class PrivacyContentControl : ContentControl
public static readonly StyledProperty<uint> NumberOfPrivacyCharsProperty =
AvaloniaProperty.Register<PrivacyContentControl, uint>(nameof(NumberOfPrivacyChars), 5);
- public static readonly StyledProperty<string> PrivacyTextProperty =
- AvaloniaProperty.Register<PrivacyContentControl, string>(nameof(PrivacyText));
-
public static readonly StyledProperty<ReplacementMode> PrivacyReplacementModeProperty =
AvaloniaProperty.Register<PrivacyContentControl, ReplacementMode>(nameof(PrivacyReplacementMode));
@@ -50,21 +47,22 @@ public class PrivacyContentControl : ContentControl
.Replay(1)
.RefCount();
- PrivacyText = TextHelpers.GetPrivacyMask((int) NumberOfPrivacyChars);
+ PrivacyText =this.WhenAnyValue(x => x.NumberOfPrivacyChars)
+ .Select(n => TextHelpers.GetPrivacyMask((int) NumberOfPrivacyChars))
+ .Replay(1)
+ .RefCount();
}
+ public IObservable<string> PrivacyText { get; } = Observable.Empty<string>();
+
+ private IObservable<bool> IsContentRevealed { get; } = Observable.Empty<bool>();
+
public uint NumberOfPrivacyChars
{
get => GetValue(NumberOfPrivacyCharsProperty);
set => SetValue(NumberOfPrivacyCharsProperty, value);
}
- private string PrivacyText
- {
- get => GetValue(PrivacyTextProperty);
- set => SetValue(PrivacyTextProperty, value);
- }
-
public ReplacementMode PrivacyReplacementMode
{
get => GetValue(PrivacyReplacementModeProperty);
@@ -76,6 +74,4 @@ public class PrivacyContentControl : ContentControl
get => GetValue(ForceShowProperty);
set => SetValue(ForceShowProperty, value);
}
-
- private IObservable<bool> IsContentRevealed { get; } = Observable.Empty<bool>();
}

Fix PrivacyText