migrate balance tile to new tile control.
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TilePresetViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TilePresetViewModel.cs
+using WalletWasabi.Fluent.Controls;
+
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
public partial class TilePresetViewModel : ViewModelBase

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TileViewModel.cs
using System;
using System.Collections.ObjectModel;
using ReactiveUI;
+using WalletWasabi.Fluent.Controls;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
@@ -8,10 +9,12 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
[AutoNotify] private ObservableCollection<TilePresetViewModel>? _tilePresets;
[AutoNotify] private int _tilePresetIndex;
+ [AutoNotify] private TileSize _currentTileSize;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isSmallPreset;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isNormalPreset;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isWidePreset;
+
protected TileViewModel()
{
this.WhenAnyValue(x => x.TilePresetIndex)
@@ -46,6 +49,8 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
private void UpdatePresetFlags()
{
+ CurrentTileSize = CurrentTilePreset?.TileSize ?? TileSize.Normal;
+
IsSmallPreset = CurrentTilePreset?.TileSize == TileSize.Small;
IsNormalPreset = CurrentTilePreset?.TileSize == TileSize.Normal;
IsWidePreset = CurrentTilePreset?.TileSize == TileSize.Wide;

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -10,6 +10,7 @@ using System.Threading.Tasks;
using NBitcoin;
using WalletWasabi.Fluent.ViewModels.Navigation;
using System.Windows.Input;
+using WalletWasabi.Fluent.Controls;
using WalletWasabi.Fluent.ViewModels.Dialogs.Authorization;
using WalletWasabi.Fluent.ViewModels.Dialogs.Base;
using WalletWasabi.Fluent.ViewModels.Wallets.Advanced;

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceChart/WalletBalanceChartNormalTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceChart/WalletBalanceChartNormalTileView.axaml
<UserControl.Styles>
<StyleInclude Source="avares://WalletWasabi.Fluent/Styles/BalanceLineChart.axaml" />
</UserControl.Styles>
- <Border ClipToBounds="False" CornerRadius="5" Background="{DynamicResource TileRegionColor}" Margin="6" Padding="16" BoxShadow="{DynamicResource InfoBoxShadow}">
<DockPanel>
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Stretch" Spacing="10">
<TextBlock Text="Balance over time" />
<Separator DockPanel.Dock="Top" Margin="-16 10" />
- <c:LineChart x:CompileBindings="True" x:DataType="vm:WalletBalanceChartTileViewModel" x:Name="GradientLineChart" DockPanel.Dock="Bottom" Margin="30 10 15 30"
+ <c:LineChart x:CompileBindings="True" x:DataType="vm:WalletBalanceChartTileViewModel" x:Name="GradientLineChart"
+ DockPanel.Dock="Bottom" Margin="30 10 15 30"
Classes="area border xAxis xAxisLabels yAxis yAxisLabels"
SmoothCurve="True"
XAxisMinimum="{Binding XMinimum}"
</c:LineChart.AreaStroke>
</c:LineChart>
</DockPanel>
- </Border>
</UserControl>
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceTileView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
xmlns:wb="clr-namespace:WalletWasabi.Fluent.Views.Wallets.Home.Tiles.WalletBalance"
+ xmlns:controls="clr-namespace:WalletWasabi.Fluent.Controls"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:CompileBindings="True" x:DataType="vm:WalletBalanceTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.WalletBalanceTileView">
- <Panel>
- <wb:WalletBalanceSmallTileView IsVisible="{Binding IsSmallPreset}"/>
- <wb:WalletBalanceNormalTileView IsVisible="{Binding IsNormalPreset}"/>
- <wb:WalletBalanceWideTileView IsVisible="{Binding IsWidePreset}"/>
- </Panel>
+ <controls:TileControl TileSize="{Binding CurrentTileSize}">
+ <wb:WalletBalanceSmallTileView />
+ <controls:TileControl.LargeSizeContent>
+ <wb:WalletBalanceNormalTileView />
+ </controls:TileControl.LargeSizeContent>
+ <controls:TileControl.WideSizeContent>
+ <wb:WalletBalanceWideTileView />
+ </controls:TileControl.WideSizeContent>
+ </controls:TileControl>
</UserControl>
\ No newline at end of file

migrate balance tile to new tile control.