Add a simple tilecontrol that handles different content for different sizes.
MODIFY
WalletWasabi.Fluent/App.axaml
WalletWasabi.Fluent/App.axaml
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/QuestionControl.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/PreviewItem.axaml" />
<StyleInclude Source="avares://WalletWasabi.Fluent/Controls/AdorningContentControl.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:controls="using:WalletWasabi.Fluent.Controls">
+ <Design.PreviewWith>
+ <controls:TileControl />
+ </Design.PreviewWith>
+
+ <Style Selector="controls|TileControl">
+ <!-- Set Defaults -->
+ <Setter Property="Template">
+ <ControlTemplate>
+ <Border ClipToBounds="False" CornerRadius="5" Background="{DynamicResource TileRegionColor}" Margin="6" Padding="16" BoxShadow="{DynamicResource InfoBoxShadow}">
+ <ContentPresenter Name="PART_ContentPresenter"
+ Background="{TemplateBinding Background}"
+ Padding="{TemplateBinding Padding}"
+ VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
+ HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/>
+ </Border>
+ </ControlTemplate>
+ </Setter>
+ </Style>
+</Styles>

ADD
WalletWasabi.Fluent/Controls/TileControl.axaml.cs
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Controls.Presenters;
+using Avalonia.Controls.Primitives;
+
+namespace WalletWasabi.Fluent.Controls
+{
+ public class TileControl : ContentControl
+ {
+ private ContentPresenter? _contentPresenter;
+
+ public static readonly StyledProperty<object> LargeSizeContentProperty =
+ AvaloniaProperty.Register<TileControl, object>(nameof(LargeSizeContent));
+
+ public static readonly StyledProperty<object> WideSizeContentProperty =
+ AvaloniaProperty.Register<TileControl, object>(nameof(WideSizeContent));
+
+ public static readonly StyledProperty<TileSize> TileSizeProperty =
+ AvaloniaProperty.Register<TileControl, TileSize>(nameof(TileSize));
+
+ public object LargeSizeContent
+ {
+ get => GetValue(LargeSizeContentProperty);
+ set => SetValue(LargeSizeContentProperty, value);
+ }
+
+ public object WideSizeContent
+ {
+ get => GetValue(WideSizeContentProperty);
+ set => SetValue(WideSizeContentProperty, value);
+ }
+
+ public TileSize TileSize
+ {
+ get => GetValue(TileSizeProperty);
+ set => SetValue(TileSizeProperty, value);
+ }
+
+ private void UpdateContent()
+ {
+ if (_contentPresenter is { })
+ {
+ switch (TileSize)
+ {
+ case TileSize.Small:
+ _contentPresenter.Content = Content;
+ break;
+
+ case TileSize.Normal:
+ _contentPresenter.Content = LargeSizeContent;
+ break;
+
+ case TileSize.Wide:
+ _contentPresenter.Content = WideSizeContent;
+ break;
+ }
+ }
+ }
+
+ protected override void OnApplyTemplate(TemplateAppliedEventArgs e)
+ {
+ base.OnApplyTemplate(e);
+
+ _contentPresenter = e.NameScope.Find<ContentPresenter>("PART_ContentPresenter");
+
+ UpdateContent();
+ }
+
+ protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
+ {
+ base.OnPropertyChanged(change);
+
+ if (change.Property == TileSizeProperty)
+ {
+ UpdateContent();
+ }
+ }
+ }
+}
\ No newline at end of file

ADD
WalletWasabi.Fluent/Controls/TileSize.cs
+namespace WalletWasabi.Fluent.Controls
+{
+ public enum TileSize
+ {
+ Small,
+ Normal,
+ Wide
+ }
+}
\ No newline at end of file

DELETE
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TileSize.cs
-namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
-{
- public enum TileSize
- {
- Small,
- Normal,
- Wide
- }
-}
\ No newline at end of file

Add a simple tilecontrol that handles different content for different sizes.