using BlankApp1.Common; using PLCTool.Views.MonitorManageView; using Prism.Commands; using Prism.Regions; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace PLCTool.ViewModels.MonitorManageViewModel { public class PLCPointViewModel { private readonly IRegionManager _regionManager; public PLCPointViewModel(IRegionManager regionManager) { _regionManager = regionManager; ButtonNavigateCommand = new DelegateCommand(NavigateMethod); OnLoadCommand = new DelegateCommand(OnLoad); } private void OnLoad() { _regionManager.Regions["PLCRegion"].RequestNavigate("PLCReadView"); } private void NavigateMethod(string strPar) { if (strPar == null || string.IsNullOrWhiteSpace(strPar)) { return; } //导航页面 _regionManager.Regions["PLCRegion"].RequestNavigate(strPar); } #region 命令绑定 public DelegateCommand OnLoadCommand { set; get; } public DelegateCommand ButtonNavigateCommand { set; get; } #endregion } }