Style refinement
MODIFY
WalletWasabi.Fluent/App.axaml
WalletWasabi.Fluent/App.axaml
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/LabelsItemsPresenter.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/SuggestionItem.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/ClipboardCopyButton.axaml" />
+ <StyleInclude Source="avares://WalletWasabi.Fluent/Controls/ClipboardCopyButton.axaml" />
+ <StyleInclude Source="avares://WalletWasabi.Fluent/Controls/TileControl.axaml" />
</Application.Styles>
<NativeMenu.Menu>
<NativeMenu>

ADD
WalletWasabi.Fluent/Controls/TileControl.axaml
+<Styles xmlns="https://github.com/avaloniaui"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls">
+ <Design.PreviewWith>
+ <c:TileControl Height="140" Width="310" Title="Tile">
+ <c:TileControl.BottomContent>
+ <Button VerticalAlignment="Stretch">Bye</Button>
+ </c:TileControl.BottomContent>
+ <Button VerticalAlignment="Bottom">hello</Button>
+ </c:TileControl>
+ </Design.PreviewWith>
+
+ <Style Selector="c|TileControl">
+ <Setter Property="SeparatorMargin" Value="0 6"></Setter>
+ <Setter Property="BottomPartHeight" Value="22"></Setter>
+ <Setter Property="Template">
+ <ControlTemplate>
+ <HeaderedContentControl Classes="tile" Header="{TemplateBinding Title}">
+ <DockPanel>
+ <StackPanel DockPanel.Dock="Bottom" Name="PART_BottomContent" IsVisible="{TemplateBinding IsBottomContentVisible}">
+ <Separator DockPanel.Dock="Bottom" Margin="{TemplateBinding SeparatorMargin}" />
+ <Viewbox Height="{TemplateBinding BottomPartHeight}">
+ <ContentPresenter Content="{TemplateBinding BottomContent}" />
+ </Viewbox>
+ </StackPanel>
+ <ContentPresenter Name="PART_Content" Content="{TemplateBinding Content}" />
+ </DockPanel>
+ </HeaderedContentControl>
+ </ControlTemplate>
+ </Setter>
+ </Style>
+</Styles>

ADD
WalletWasabi.Fluent/Controls/TileControl.axaml.cs
+using Avalonia;
+using Avalonia.Controls;
+
+namespace WalletWasabi.Fluent.Controls;
+
+public class TileControl : ContentControl
+{
+ public static readonly StyledProperty<string> TitleProperty = AvaloniaProperty.Register<TileControl, string>("Title");
+
+ public string Title
+ {
+ get => GetValue(TitleProperty);
+ set => SetValue(TitleProperty, value);
+ }
+
+ public static readonly StyledProperty<object> BottomContentProperty = AvaloniaProperty.Register<TileControl, object>("BottomContent");
+
+ public object BottomContent
+ {
+ get => GetValue(BottomContentProperty);
+ set => SetValue(BottomContentProperty, value);
+ }
+
+ public static readonly StyledProperty<bool> IsBottomContentVisibleProperty = AvaloniaProperty.Register<TileControl, bool>("IsBottomContentVisible", true);
+
+ public bool IsBottomContentVisible
+ {
+ get => GetValue(IsBottomContentVisibleProperty);
+ set => SetValue(IsBottomContentVisibleProperty, value);
+ }
+
+ public static readonly StyledProperty<Thickness> SeparatorMarginProperty = AvaloniaProperty.Register<TileControl, Thickness>("SeparatorMargin");
+
+ public Thickness SeparatorMargin
+ {
+ get => GetValue(SeparatorMarginProperty);
+ set => SetValue(SeparatorMarginProperty, value);
+ }
+
+ public static readonly StyledProperty<double> BottomPartHeightProperty = AvaloniaProperty.Register<TileControl, double>("BottomPartHeight");
+
+ public double BottomPartHeight
+ {
+ get => GetValue(BottomPartHeightProperty);
+ set => SetValue(BottomPartHeightProperty, value);
+ }
+}

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/BtcPriceTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/BtcPriceTileView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
+ xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:CompileBindings="True" x:DataType="vm:BtcPriceTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.BtcPriceTileView">
- <HeaderedContentControl Header="EXCHANGE RATE" Classes="tile">
+ <controls:TileControl Title="EXCHANGE RATE" IsBottomContentVisible="False">
<TextBlock Margin="0 3"
Classes="h2 monoSpaced"
VerticalAlignment="Center" HorizontalAlignment="Center"
TextAlignment="Center"
Text="{Binding UsdPerBtc^, Converter={x:Static converters:MoneyConverters.ToUsd}}" />
- </HeaderedContentControl>
+ </controls:TileControl>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyBar/PrivacyBar.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyBar/PrivacyBar.axaml
</i:Interaction.Behaviors>
<Button Classes="plain" Command="{Binding ShowDetailsCommand}"
- Margin="0 0 0 6"
ToolTip.Tip="Show Details"
IsVisible="{Binding !!PrivacyBar.Items.Count}">
<ItemsControl Items="{Binding PrivacyBar.Items}" Height="8">

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyControlTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/PrivacyControlTileView.axaml
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:tiles="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:privacyBar="clr-namespace:WalletWasabi.Fluent.Views.Wallets.Home.Tiles.PrivacyBar"
- mc:Ignorable="d" d:DesignWidth="320" d:DesignHeight="140"
+ mc:Ignorable="d" d:DesignWidth="310" d:DesignHeight="140"
x:CompileBindings="True" x:DataType="tiles:PrivacyControlTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.PrivacyControlTileView">
- <HeaderedContentControl Header="PRIVACY PROGRESS" Classes="tile">
- <DockPanel>
- <StackPanel DockPanel.Dock="Bottom" IsVisible="{Binding HasPrivateBalance}">
- <Separator />
- <StackPanel Opacity="0.8" Orientation="Horizontal" Spacing="10" Margin="8" HorizontalAlignment="Center">
- <Border VerticalAlignment="Center" BorderThickness="1" CornerRadius="2"
- BorderBrush="{StaticResource ButtonForeground}">
- <TextBlock
- Text="PRIVATE" Classes="bold" Margin="4 2 " VerticalAlignment="Center" HorizontalAlignment="Center" />
- </Border>
- <controls:PrivacyContentControl Classes="bold" NumberOfPrivacyChars="9"
- VerticalAlignment="Center"
- Content="{Binding BalancePrivateBtc}" />
- </StackPanel>
- </StackPanel>
- <privacyBar:PrivacyBar DockPanel.Dock="Bottom" />
+ <c:TileControl Title="PRIVACY PROGRESS">
- <StackPanel VerticalAlignment="Center" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0 3">
+ <DockPanel VerticalAlignment="Bottom">
+ <privacyBar:PrivacyBar Margin="0 10 0 0" DockPanel.Dock="Bottom" />
+ <StackPanel Margin="0 10 0 0" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Command="{Binding ShowDetailsCommand}" Classes="plain"
- ToolTip.Tip="Show Details" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0 0 10 0"
+ ToolTip.Tip="Show Details" VerticalAlignment="Center" HorizontalAlignment="Center"
Height="36" Width="36">
<Image Source="{StaticResource privacy_indicator_good}" />
</Button>
-
<TextBlock
- VerticalAlignment="Center" HorizontalAlignment="Center"
+ HorizontalAlignment="Center"
TextAlignment="Center"
Text="{Binding PercentText}" Classes="h2" />
</StackPanel>
</DockPanel>
- </HeaderedContentControl>
+
+ <c:TileControl.BottomContent>
+ <StackPanel Opacity="0.8" Orientation="Horizontal" Spacing="10" HorizontalAlignment="Center">
+ <Border VerticalAlignment="Center" BorderThickness="1" CornerRadius="2"
+ BorderBrush="{StaticResource ButtonForeground}">
+ <TextBlock
+ Text="PRIVATE" Classes="bold" Margin="4 2" VerticalAlignment="Center" HorizontalAlignment="Center" />
+ </Border>
+ <c:PrivacyContentControl Classes="bold" NumberOfPrivacyChars="9"
+ VerticalAlignment="Center"
+ Content="{Binding BalancePrivateBtc}" />
+ </StackPanel>
+ </c:TileControl.BottomContent>
+ </c:TileControl>
+
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceTileView.axaml
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
+ xmlns:c="clr-namespace:WalletWasabi.Fluent.Controls"
xmlns:converters="clr-namespace:WalletWasabi.Fluent.Converters"
+ xmlns:tiles="clr-namespace:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
mc:Ignorable="d" d:DesignWidth="320" d:DesignHeight="140"
+ x:CompileBindings="True"
+ x:DataType="tiles:WalletBalanceTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.WalletBalanceTileView">
- <HeaderedContentControl Header="BALANCE" Classes="tile">
- <DockPanel>
- <StackPanel DockPanel.Dock="Bottom" Spacing="8" IsVisible="{Binding HasBalance^}">
- <Separator />
- <controls:PrivacyContentControl Classes="bold monoSpaced" NumberOfPrivacyChars="9" Margin="4"
- VerticalAlignment="Center"
- HorizontalAlignment="Center"
- Opacity="0.8"
- Content="{Binding BalanceFiat^, Converter={x:Static converters:MoneyConverters.ToUsdAproxBetweenParens}}" />
- </StackPanel>
+ <c:TileControl Title="BALANCE" IsBottomContentVisible="{Binding HasBalance^}" SeparatorMargin="0 0 0 6">
<Viewbox Margin="0 3" VerticalAlignment="Center" MaxHeight="40">
- <controls:PrivacyContentControl NumberOfPrivacyChars="16"
- Classes="h2 monoSpaced"
- HorizontalContentAlignment="Center"
+ <c:PrivacyContentControl NumberOfPrivacyChars="16" Classes="h2 monoSpaced" HorizontalContentAlignment="Center"
Content="{Binding BalanceBtc^}" />
</Viewbox>
- </DockPanel>
- </HeaderedContentControl>
+
+ <c:TileControl.BottomContent>
+ <c:PrivacyContentControl Classes="bold monoSpaced" NumberOfPrivacyChars="9" Margin="4" VerticalAlignment="Center"
+ HorizontalAlignment="Center" Opacity="0.8"
+ Content="{Binding BalanceFiat^, Converter={x:Static converters:MoneyConverters.ToUsdAproxBetweenParens}}" />
+ </c:TileControl.BottomContent>
+
+ </c:TileControl>
</UserControl>

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/TilesView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/TilesView.axaml
Background="{DynamicResource TileRegionColor}"
BorderBrush="{DynamicResource TileBorderColor}"
Margin="0 0 10 0">
- <ContentControl Padding="16" Content="{Binding}" />
+ <ContentControl Padding="12" Content="{Binding}" />
</Border>
</DataTemplate>
</Setter.Value>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
- <WrapPanel ItemWidth="320" ItemHeight="140" />
+ <WrapPanel ItemWidth="310" ItemHeight="140" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>

MODIFY
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
WalletWasabi.Fluent/WalletWasabi.Fluent.csproj
<ItemGroup>
<RuntimeHostConfigurationOption Include="System.Globalization.Invariant" Value="true" />
</ItemGroup>
+
+ <ItemGroup>
+ <Compile Update="Controls\TileControl.axaml.cs">
+ <DependentUpon>TileControl.axaml</DependentUpon>
+ </Compile>
+ </ItemGroup>
</Project>

Style refinement