// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Author(s) : Natalia Portillo // // Component : Text User Interface. // // --[ License ] -------------------------------------------------------------- // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program. If not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2025 Natalia Portillo // ****************************************************************************/ using CommunityToolkit.Mvvm.ComponentModel; namespace Aaru.Tui.ViewModels; public class ViewModelBase : ObservableObject, IRegionAware { /// /// Called to determine if this instance can handle the navigation request. /// Don't call this directly, use . /// /// The navigation context. /// if this instance accepts the navigation request; otherwise, . public virtual bool IsNavigationTarget(NavigationContext navigationContext) => // Auto-allow navigation OnNavigatingTo(navigationContext); /// Called when the implementer is being navigated away from. /// The navigation context. public virtual void OnNavigatedFrom(NavigationContext navigationContext) {} /// Called when the implementer has been navigated to. /// The navigation context. public virtual void OnNavigatedTo(NavigationContext navigationContext) {} /// Navigation validation checker. /// Override for Prism 7.2's IsNavigationTarget. /// The navigation context. /// if this instance accepts the navigation request; otherwise, . public virtual bool OnNavigatingTo(NavigationContext navigationContext) => true; }