|
|
|
@ -25,7 +25,6 @@ public partial class MainWindowViewModel : ViewModelBase
|
|
|
|
|
private readonly ISettingsManager settingsManager; |
|
|
|
|
private readonly ServiceManager<ViewModelBase> dialogFactory; |
|
|
|
|
private readonly IDiscordRichPresenceService discordRichPresenceService; |
|
|
|
|
private readonly INavigationService navigationService; |
|
|
|
|
public string Greeting => "Welcome to Avalonia!"; |
|
|
|
|
|
|
|
|
|
[ObservableProperty] |
|
|
|
@ -46,13 +45,11 @@ public partial class MainWindowViewModel : ViewModelBase
|
|
|
|
|
public MainWindowViewModel( |
|
|
|
|
ISettingsManager settingsManager, |
|
|
|
|
IDiscordRichPresenceService discordRichPresenceService, |
|
|
|
|
ServiceManager<ViewModelBase> dialogFactory, |
|
|
|
|
INavigationService navigationService) |
|
|
|
|
ServiceManager<ViewModelBase> dialogFactory) |
|
|
|
|
{ |
|
|
|
|
this.settingsManager = settingsManager; |
|
|
|
|
this.dialogFactory = dialogFactory; |
|
|
|
|
this.discordRichPresenceService = discordRichPresenceService; |
|
|
|
|
this.navigationService = navigationService; |
|
|
|
|
|
|
|
|
|
ProgressManagerViewModel = dialogFactory.Get<ProgressManagerViewModel>(); |
|
|
|
|
UpdateViewModel = dialogFactory.Get<UpdateViewModel>(); |
|
|
|
@ -65,8 +62,6 @@ public partial class MainWindowViewModel : ViewModelBase
|
|
|
|
|
// Set only if null, since this may be called again when content dialogs open |
|
|
|
|
CurrentPage ??= Pages.FirstOrDefault(); |
|
|
|
|
SelectedCategory ??= Pages.FirstOrDefault(); |
|
|
|
|
|
|
|
|
|
EventManager.Instance.PageChangeRequested += OnPageChangeRequested; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public override async Task OnLoadedAsync() |
|
|
|
@ -198,19 +193,4 @@ public partial class MainWindowViewModel : ViewModelBase
|
|
|
|
|
|
|
|
|
|
await dialog.ShowAsync(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private void OnPageChangeRequested(object? sender, Type e) |
|
|
|
|
{ |
|
|
|
|
CurrentPage = Pages.FirstOrDefault(p => p.GetType() == e); |
|
|
|
|
SelectedCategory = Pages.FirstOrDefault(p => p.GetType() == e); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
partial void OnSelectedCategoryChanged(object? value) |
|
|
|
|
{ |
|
|
|
|
if (value is PageViewModelBase page) |
|
|
|
|
{ |
|
|
|
|
// CurrentPage = page; |
|
|
|
|
// navigationService.NavigateTo(page); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|