// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file, You can obtain one at https://opensource.org/licenses/MIT.
// Copyright (C) Leszek Pomianowski and WPF UI Contributors.
// All Rights Reserved.
using Wpf.Ui.Abstractions.Controls;
namespace Wpf.Ui.Demo.Mvvm.ViewModels;
public abstract class ViewModel : ObservableObject, INavigationAware
{
///
public virtual Task OnNavigatedToAsync()
{
OnNavigatedTo();
return Task.CompletedTask;
}
///
/// Handles the event that is fired after the component is navigated to.
///
// ReSharper disable once MemberCanBeProtected.Global
public virtual void OnNavigatedTo() { }
///
public virtual Task OnNavigatedFromAsync()
{
OnNavigatedFrom();
return Task.CompletedTask;
}
///
/// Handles the event that is fired before the component is navigated from.
///
// ReSharper disable once MemberCanBeProtected.Global
public virtual void OnNavigatedFrom() { }
}