| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- using Prism.Commands;
- using Prism.Events;
- using Prism.Ioc;
- using Prism.Mvvm;
- using Prism.Regions;
- using Prism.Services.Dialogs;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using TeamAAS_VP.Events;
- namespace TeamAAS_VP.ViewModels
- {
- public class CalibrationViewModel : BindableBase
- {
- IRegionManager _regionManager;
- IRegionNavigationService _regionNavigationService;
- IContainerProvider _container;
- IDialogService _dialogService;
- IEventAggregator _eventAggregator;
- #region 属性
- #endregion
- #region 命令
- private DelegateCommand _LoadedCommand;
- public DelegateCommand LoadedCommand =>
- _LoadedCommand ?? (_LoadedCommand = new DelegateCommand(ExecuteLoadedCommand));
-
- #endregion
- #region 事件
- #endregion
- public CalibrationViewModel(IRegionManager regionManager, IEventAggregator ea, IRegionNavigationService regionNavigationService, IContainerProvider container, IDialogService dialogService)
- {
- _regionManager = regionManager;
- _regionNavigationService = regionNavigationService;
- _container = container;
- _dialogService = dialogService;
- _eventAggregator = ea;
- //订阅权限登录事件
- _eventAggregator.GetEvent<UserLoginNotification>().Subscribe(LoginChange);
- }
- #region 方法
- bool isFirstShow = false;
- void ExecuteLoadedCommand()
- {
- if (!isFirstShow)
- {
- _regionManager.RequestNavigate("CalibrationRegionContext", "CalibrationHome");
- isFirstShow = true;
- }
- }
- #endregion
- private void LoginChange(Models.User user)
- {
- }
- }
- }
|