模块化

This commit is contained in:
hsc
2025-12-23 15:07:51 +08:00
parent 4da28d08a8
commit 72f3b855d8
51 changed files with 1356 additions and 302 deletions

View File

@@ -0,0 +1,27 @@
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 DialogViewModelBase : BindableBase,IDialogAware
{
public DialogCloseListener RequestClose { get; set; }
public IEventAggregator _eventAggregator;
private INotificationManager _notificationManager;
public DialogViewModelBase(IContainerProvider containerProvider)
{
_eventAggregator = containerProvider.Resolve<IEventAggregator>();
_notificationManager = containerProvider.Resolve<INotificationManager>();
}
#region Dialog
public virtual bool CanCloseDialog() => true;
public virtual void OnDialogClosed() { }
public virtual void OnDialogOpened(IDialogParameters parameters) { }
#endregion
}
}

View File

@@ -0,0 +1,36 @@
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
}
}