Files
辉鸭蛋 46ebdfc452 wpfui 4.0.0 (#1255)
* new INavigationAware, remove PageService

* fix run

* fix title bar

* override OnNavigatedTo

* try fix WindowStartupLocation
2025-03-13 00:33:31 +08:00

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() { }
}