Add TileSize enum
MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TilePresetViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TilePresetViewModel.cs
@@ -2,6 +2,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
public partial class TilePresetViewModel : ViewModelBase
{
+ [AutoNotify] private TileSize _tileSize;
[AutoNotify] private int _column;
[AutoNotify] private int _row;
[AutoNotify] private int _columnSpan;
@@ -12,12 +13,13 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
}
- public TilePresetViewModel(int column, int row, int columnSpan, int rowSpan, bool isVisible = true)
+ public TilePresetViewModel(int column, int row, int columnSpan, int rowSpan, TileSize tileSize, bool isVisible = true)
{
Column = column;
Row = row;
ColumnSpan = columnSpan;
RowSpan = rowSpan;
+ TileSize = tileSize;
IsVisible = isVisible;
}
}

ADD
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

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/TileViewModel.cs
@@ -8,9 +8,6 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
[AutoNotify] private ObservableCollection<TilePresetViewModel>? _tilePresets;
[AutoNotify] private int _tilePresetIndex;
- [AutoNotify] private int _smallPresetIndex;
- [AutoNotify] private int _normalPresetIndex;
- [AutoNotify] private int _widePresetIndex;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isSmallPreset;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isNormalPreset;
[AutoNotify(SetterModifier = AccessModifier.Private)] private bool _isWidePreset;
@@ -18,9 +15,9 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
protected TileViewModel()
{
this.WhenAnyValue(x => x.TilePresetIndex)
- .Subscribe(x =>
+ .Subscribe(_ =>
{
- SetPresetFlag(x);
+ UpdatePresetFlags();
NotifyPresetChanged();
});
}
@@ -47,11 +44,11 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
this.RaisePropertyChanged(nameof(IsVisible));
}
- private void SetPresetFlag(int presetIndex)
+ private void UpdatePresetFlags()
{
- IsSmallPreset = presetIndex == _smallPresetIndex;
- IsNormalPreset = presetIndex == _normalPresetIndex;
- IsWidePreset = presetIndex == _widePresetIndex;
+ IsSmallPreset = CurrentTilePreset?.TileSize == TileSize.Small;
+ IsNormalPreset = CurrentTilePreset?.TileSize == TileSize.Normal;
+ IsWidePreset = CurrentTilePreset?.TileSize == TileSize.Wide;
}
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/WalletViewModel.cs
@@ -77,66 +77,51 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets
{
TilePresets = new ObservableCollection<TilePresetViewModel>()
{
- new(0, 0, 1, 1),
- new(0, 0, 1, 1),
- new(0, 0, 1, 1)
+ new(0, 0, 1, 1, TileSize.Small),
+ new(0, 0, 1, 1, TileSize.Small),
+ new(0, 0, 1, 1, TileSize.Small)
},
- TilePresetIndex = LayoutIndex,
- SmallPresetIndex = 0,
- NormalPresetIndex = 1,
- WidePresetIndex = 2
+ TilePresetIndex = LayoutIndex
};
RoundStatusTile = new RoundStatusTileViewModel(wallet)
{
TilePresets = new ObservableCollection<TilePresetViewModel>()
{
- new(1, 0, 1, 1),
- new(1, 0, 1, 1),
- new(1, 0, 1, 1)
+ new(1, 0, 1, 1, TileSize.Small),
+ new(1, 0, 1, 1, TileSize.Small),
+ new(1, 0, 1, 1, TileSize.Small)
},
- TilePresetIndex = LayoutIndex,
- SmallPresetIndex = 0,
- NormalPresetIndex = 1,
- WidePresetIndex = 2
+ TilePresetIndex = LayoutIndex
};
BtcPriceTile = new BtcPriceTileViewModel(wallet)
{
TilePresets = new ObservableCollection<TilePresetViewModel>()
{
- new(2, 0, 1, 1),
- new(2, 0, 1, 1),
- new(0, 1, 1, 1)
+ new(2, 0, 1, 1, TileSize.Small),
+ new(2, 0, 1, 1, TileSize.Small),
+ new(0, 1, 1, 1, TileSize.Normal)
},
- TilePresetIndex = LayoutIndex,
- SmallPresetIndex = 0,
- NormalPresetIndex = 1,
- WidePresetIndex = 2
+ TilePresetIndex = LayoutIndex
};
WalletPieChart = new WalletPieChartTileViewModel(wallet, balanceChanged)
{
TilePresets = new ObservableCollection<TilePresetViewModel>()
{
- new(3, 0, 1, 1),
- new(0, 1, 1, 1),
- new(1, 1, 1, 1)
+ new(3, 0, 1, 1, TileSize.Small),
+ new(0, 1, 1, 1, TileSize.Normal),
+ new(1, 1, 1, 1, TileSize.Normal)
},
- TilePresetIndex = LayoutIndex,
- SmallPresetIndex = 0,
- NormalPresetIndex = 1,
- WidePresetIndex = 2
+ TilePresetIndex = LayoutIndex
};
BalanceChartTile = new WalletBalanceChartTileViewModel(History.UnfilteredTransactions)
{
TilePresets = new ObservableCollection<TilePresetViewModel>()
{
- new(4, 0, 1, 1),
- new(1, 1, 2, 1),
- new(0, 2, 2, 1)
+ new(4, 0, 1, 1, TileSize.Small),
+ new(1, 1, 2, 1, TileSize.Wide),
+ new(0, 2, 2, 1, TileSize.Wide)
},
- TilePresetIndex = LayoutIndex,
- SmallPresetIndex = 0,
- NormalPresetIndex = 1,
- WidePresetIndex = 2
+ TilePresetIndex = LayoutIndex
};
_tiles = new List<TileViewModel>

Add TileSize enum