Add UseOpacity property to PrivacyContentControl
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:conv="using:WalletWasabi.Fluent.Converters">
<Design.PreviewWith>
<controls:PrivacyContentControl />
</Design.PreviewWith>
<Panel>
<ContentPresenter Name="PART_Content"
- IsVisible="{Binding IsContentRevealed^, RelativeSource={RelativeSource Mode=TemplatedParent}}"
ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
</Setter>
</Style>
+ <Style Selector="controls|PrivacyContentControl">
+ <Setter Property="VerticalContentAlignment" Value="Center" />
+ </Style>
+
<Style Selector="controls|PrivacyContentControl /template/ Viewbox#PART_Icon">
<Setter Property="Margin" Value="25" />
<Setter Property="Opacity" Value="0.15" />
<Style Selector="controls|PrivacyContentControl[PrivacyReplacementMode=Text] /template/ Viewbox#PART_Icon">
<Setter Property="IsVisible" Value="False" />
</Style>
+
+ <!-- UseOpacity = true -->
+ <Style Selector="controls|PrivacyContentControl[UseOpacity=True] /template/ ContentPresenter#PART_Content">
+ <Setter Property="Opacity" Value="{Binding IsContentRevealed^, RelativeSource={RelativeSource TemplatedParent}, Converter={x:Static conv:BoolOpacityConverters.BoolToOpacity}}" />
+ <Setter Property="IsEnabled" Value="{Binding IsContentRevealed^, RelativeSource={RelativeSource TemplatedParent}}" />
+ <Setter Property="IsHitTestVisible" Value="{Binding IsContentRevealed^, RelativeSource={RelativeSource TemplatedParent}}" />
+ </Style>
+
+ <!-- UseOpacity = false -->
+ <Style Selector="controls|PrivacyContentControl[UseOpacity=False] /template/ ContentPresenter#PART_Content">
+ <Setter Property="IsVisible" Value="{Binding IsContentRevealed^, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
+ </Style>
</Styles>

MODIFY
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
WalletWasabi.Fluent/Controls/PrivacyContentControl.axaml.cs
@@ -24,6 +24,9 @@ public class PrivacyContentControl : ContentControl
public static readonly StyledProperty<bool> ForceShowProperty =
AvaloniaProperty.Register<PrivacyContentControl, bool>(nameof(ForceShow));
+ public static readonly StyledProperty<bool> UseOpacityProperty =
+ AvaloniaProperty.Register<PrivacyContentControl, bool>(nameof(UseOpacity), defaultValue: true);
+
public PrivacyContentControl()
{
if (Design.IsDesignMode)
@@ -65,4 +68,10 @@ public class PrivacyContentControl : ContentControl
get => GetValue(ForceShowProperty);
set => SetValue(ForceShowProperty, value);
}
+
+ public bool UseOpacity
+ {
+ get => GetValue(UseOpacityProperty);
+ set => SetValue(UseOpacityProperty, value);
+ }
}

Add UseOpacity property to PrivacyContentControl