mirror of
https://github.com/babalae/better-genshin-impact.git
synced 2026-03-19 08:19:48 +08:00
* new INavigationAware, remove PageService * fix run * fix title bar * override OnNavigatedTo * try fix WindowStartupLocation
36 lines
974 B
C#
36 lines
974 B
C#
using System.Threading.Tasks;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using Wpf.Ui.Abstractions.Controls;
|
|
|
|
namespace BetterGenshinImpact.ViewModel;
|
|
|
|
public abstract partial class ViewModel : ObservableObject, INavigationAware, IViewModel
|
|
{
|
|
/// <inheritdoc />
|
|
public virtual Task OnNavigatedToAsync()
|
|
{
|
|
OnNavigatedTo();
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handles the event that is fired after the component is navigated to.
|
|
/// </summary>
|
|
// ReSharper disable once MemberCanBeProtected.Global
|
|
public virtual void OnNavigatedTo() { }
|
|
|
|
/// <inheritdoc />
|
|
public virtual Task OnNavigatedFromAsync()
|
|
{
|
|
OnNavigatedFrom();
|
|
|
|
return Task.CompletedTask;
|
|
}
|
|
|
|
/// <summary>
|
|
/// Handles the event that is fired before the component is navigated from.
|
|
/// </summary>
|
|
// ReSharper disable once MemberCanBeProtected.Global
|
|
public virtual void OnNavigatedFrom() { }
|
|
} |