Use Opacity instead of Visibility
MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:controls="using:WalletWasabi.Fluent.Controls">
+ xmlns:controls="using:WalletWasabi.Fluent.Controls"
+ xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity">
<Design.PreviewWith>
<controls:PrivacyContentControl />
</Design.PreviewWith>
<Setter Property="Template">
<ControlTemplate TargetType="controls:PrivacyContentControl">
<Panel Background="Transparent">
+
<ContentPresenter Name="PART_Content"
- IsVisible="{Binding IsContentRevealed^, RelativeSource={RelativeSource Mode=TemplatedParent}}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" />
- <Panel Name="PART_PrivacyReplacement"
- IsVisible="{Binding !IsContentRevealed^, RelativeSource={RelativeSource Mode=TemplatedParent}}">
+
+ <Panel Name="PART_PrivacyReplacement">
<Viewbox Name="PART_Icon">
<PathIcon Data="{StaticResource incognito_pathicon}" />
</Viewbox>
- <TextBlock Name="PART_PrivacyText"
- Text="{Binding PrivacyText^, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
+ <TextBlock Name="PART_PrivacyText" Text="{Binding PrivacyText^, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</Panel>
+
+ <i:Interaction.Behaviors>
+ <DataTriggerBehavior Binding="{Binding IsContentRevealed^, RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="True">
+ <ChangeAvaloniaPropertyAction TargetObject="PART_Content" TargetProperty="Opacity" Value="1" />
+ <ChangeAvaloniaPropertyAction TargetObject="PART_PrivacyReplacement" TargetProperty="Opacity" Value="0" />
+ </DataTriggerBehavior>
+ <DataTriggerBehavior Binding="{Binding IsContentRevealed^, RelativeSource={RelativeSource Mode=TemplatedParent}}" Value="False">
+ <ChangeAvaloniaPropertyAction TargetObject="PART_Content" TargetProperty="Opacity" Value="0" />
+ <ChangeAvaloniaPropertyAction TargetObject="PART_PrivacyReplacement" TargetProperty="Opacity" Value="1" />
+ </DataTriggerBehavior>
+ </i:Interaction.Behaviors>
+
</Panel>
</ControlTemplate>
</Setter>
</Transitions>
</Setter>
</Style>
- <Style Selector="controls|PrivacyContentControl /template/ ContentPresenter#PART_Content[IsVisible=True],
- controls|PrivacyContentControl /template/ Panel#PART_PrivacyReplacement[IsVisible=True]">
- <Setter Property="Opacity" Value="1" />
- </Style>
- <Style Selector="controls|PrivacyContentControl /template/ ContentPresenter#PART_Content[IsVisible=False],
- controls|PrivacyContentControl /template/ Panel#PART_PrivacyReplacement[IsVisible=False]">
- <Setter Property="Opacity" Value="0" />
- </Style>
<Style Selector="controls|PrivacyContentControl.monoSpaced">
<Setter Property="FontFamily" Value="{StaticResource MonospacedFont}" />

MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
@@ -34,8 +34,15 @@ public class PrivacyContentControl : ContentControl
}
var isPrivacyModeEnabled = Services.UiConfig.WhenAnyValue(x => x.PrivacyMode);
- var isPointerOver = this.WhenAnyValue(x => x.IsPointerOver).DelayTrue(RevealDelay);
var isForced = this.WhenAnyValue(x => x.ForceShow);
+ var isPointerOver = this.WhenAnyValue(x => x.IsPointerOver)
+ .Select(
+ isTrue => isTrue
+ ? Observable.Return(true).Delay(RevealDelay)
+ .Concat(Observable.Return(false).Delay(TimeSpan.FromSeconds(5)))
+ : Observable.Return(false)
+ )
+ .Switch();
var displayContent = isPrivacyModeEnabled.CombineLatest(
isPointerOver,

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceTileView.axaml
</StackPanel>
<Viewbox Margin="0 3" VerticalAlignment="Center" HorizontalAlignment="Center" MaxHeight="40">
- <controls:PrivacyContentControl NumberOfPrivacyChars="9"
+ <controls:PrivacyContentControl NumberOfPrivacyChars="16"
Classes="h2 monoSpaced"
Content="{Binding BalanceBtc}" />
</Viewbox>

Use Opacity instead of Visibility