fix(ui): avoid int CommandParameter cast crash in usage monitor presets
RelayCommand<int> casts its object parameter directly rather than
converting it, so a string CommandParameter ("7"/"30") would throw
InvalidCastException at runtime. Split into two parameterless commands.
This commit is contained in:
@@ -89,6 +89,11 @@ public sealed partial class UsageMonitorModalViewModel : ViewModelBase
|
||||
}
|
||||
|
||||
[RelayCommand]
|
||||
private Task SetPreset7Days() => SetPreset(7);
|
||||
|
||||
[RelayCommand]
|
||||
private Task SetPreset30Days() => SetPreset(30);
|
||||
|
||||
private Task SetPreset(int days)
|
||||
{
|
||||
ApplyPresetRange(days);
|
||||
|
||||
Reference in New Issue
Block a user