restore changes that was needed for the behavior
DELETE
WalletWasabi.Fluent/Behaviors/MenuFlyoutSelectedItemBehavior.cs
-using System;
-using System.Reactive.Disposables;
-using System.Reactive.Linq;
-using Avalonia;
-using Avalonia.Controls;
-using WalletWasabi.Extensions;
-using WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles;
-
-namespace WalletWasabi.Fluent.Behaviors
-{
- public class MenuFlyoutSelectedItemBehavior : DisposingBehavior<MenuFlyout>
- {
- public static readonly StyledProperty<TimePeriodOption> CurrentTimePeriodOptionProperty =
- AvaloniaProperty.Register<MenuFlyoutSelectedItemBehavior, TimePeriodOption>(nameof(CurrentTimePeriodOption));
-
- public TimePeriodOption CurrentTimePeriodOption
- {
- get => GetValue(CurrentTimePeriodOptionProperty);
- set => SetValue(CurrentTimePeriodOptionProperty, value);
- }
-
- protected override void OnAttached(CompositeDisposable disposables)
- {
- if (AssociatedObject is null)
- {
- return;
- }
-
- Observable
- .FromEventPattern(AssociatedObject, nameof(AssociatedObject.Opened))
- .Subscribe(_ =>
- {
- foreach (var item in AssociatedObject.Items)
- {
- if (item is MenuItem mi && (string) mi.Header == CurrentTimePeriodOption.FriendlyName())
- {
- mi.IsSelected = true;
- }
- }
- })
- .DisposeWith(disposables);
- }
- }
-}

MODIFY
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
WalletWasabi.Fluent/ViewModels/Wallets/Home/Tiles/WalletBalanceChartTileViewModel.cs
@@ -13,28 +13,7 @@ using WalletWasabi.Models;
namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
{
- public enum TimePeriodOption
- {
- All,
-
- [FriendlyName("1D")]
- Day,
-
- [FriendlyName("1W")]
- Week,
-
- [FriendlyName("1M")]
- Month,
-
- [FriendlyName("3M")]
- ThreeMonths,
-
- [FriendlyName("6M")]
- SixMonths,
- [FriendlyName("1Y")]
- Year
- }
public partial class WalletBalanceChartTileViewModel : TileViewModel
{
@@ -44,7 +23,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
[AutoNotify] private double? _xMinimum;
[AutoNotify] private List<string>? _yLabels;
[AutoNotify] private List<string>? _xLabels;
- [AutoNotify] private TimePeriodOption _currentTimePeriod = TimePeriodOption.ThreeMonths;
+ private TimePeriodOption _currentTimePeriod = TimePeriodOption.ThreeMonths;
public WalletBalanceChartTileViewModel(ObservableCollection<HistoryItemViewModel> history)
{
@@ -61,6 +40,17 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
AllCommand = ReactiveCommand.Create(() => { UpdateSample(TimePeriodOption.All); });
}
+ private enum TimePeriodOption
+ {
+ All,
+ Day,
+ Week,
+ Month,
+ ThreeMonths,
+ SixMonths,
+ Year
+ }
+
public ICommand DayCommand { get; }
public ICommand WeekCommand { get; }
@@ -128,7 +118,7 @@ namespace WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles
break;
}
- CurrentTimePeriod = timePeriod;
+ _currentTimePeriod = timePeriod;
}
private void UpdateSample(TimeSpan sampleTime, TimeSpan sampleBackFor)

MODIFY
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceChart/WalletBalanceChartSmallTileView.axaml
WalletWasabi.Fluent/Views/Wallets/Home/Tiles/WalletBalanceChart/WalletBalanceChartSmallTileView.axaml
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:c="using:WalletWasabi.Fluent.Controls"
xmlns:vm="using:WalletWasabi.Fluent.ViewModels.Wallets.Home.Tiles"
- xmlns:i="clr-namespace:Avalonia.Xaml.Interactivity;assembly=Avalonia.Xaml.Interactivity"
- xmlns:behaviors="using:WalletWasabi.Fluent.Behaviors"
mc:Ignorable="d" d:DesignWidth="330" d:DesignHeight="150"
x:CompileBindings="True" x:DataType="vm:WalletBalanceChartTileViewModel"
x:Class="WalletWasabi.Fluent.Views.Wallets.Home.Tiles.WalletBalanceChart.WalletBalanceChartSmallTileView">

restore changes that was needed for the behavior