Files
IOT/UIShare/ViewModelBase/NavigateViewModelBase.cs
2026-01-14 11:22:58 +08:00

37 lines
1.2 KiB
C#

using Notifications.Wpf.Core;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace UIShare.ViewModelBase
{
public abstract class NavigateViewModelBase : BindableBase, INavigationAware
{
public DialogCloseListener RequestClose { get; set; }
public IEventAggregator _eventAggregator;
public IDialogService _dialogService;
public IRegionManager _regionManager;
private INotificationManager _notificationManager;
public NavigateViewModelBase(IContainerProvider containerProvider)
{
_eventAggregator = containerProvider.Resolve<IEventAggregator>();
_dialogService = containerProvider.Resolve<IDialogService>();
_regionManager = containerProvider.Resolve<IRegionManager>();
_notificationManager = containerProvider.Resolve<INotificationManager>();
}
#region Navigation
public virtual void OnNavigatedTo(NavigationContext navigationContext) { }
public virtual bool IsNavigationTarget(NavigationContext navigationContext) => true;
public virtual void OnNavigatedFrom(NavigationContext navigationContext) { }
#endregion
}
}