123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- using FlowChartModule.绘制模块;
- using Prism.Commands;
- using Prism.Ioc;
- using Prism.Mvvm;
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
- using System.Text;
- using System.Threading;
- using System.Threading.Tasks;
- namespace FlowChartModule.ViewModels
- {
- public class ModuleViewModel : BindableBase
- {
- private string _message;
- public string Message
- {
- get { return _message; }
- set { SetProperty(ref _message, value); }
- }
- public Element _element;
- private DrawModule drawModule;
- public ModuleViewModel(IContainerProvider container)
- {
- Draw_Module = container.Resolve<DrawModule>();
- Message = "View A from your Prism Module";
- }
- private DelegateCommand _OpenDataCommand;
- public DelegateCommand OpenDataCommand =>
- _OpenDataCommand ?? ( _OpenDataCommand = new DelegateCommand(ExecuteOpenDataCommand) );
- public void ExecuteOpenDataCommand()
- {
- Draw_Module.LoadPrograms();
- }
- private DelegateCommand _SaveDataCommand;
- public DelegateCommand SaveDataCommand =>
- _SaveDataCommand ?? ( _SaveDataCommand = new DelegateCommand(ExecuteSaveDataCommand) );
- public void ExecuteSaveDataCommand()
- {
- Draw_Module.SavePrograms();
- }
- private DelegateCommand _ClearDataCommand;
- public DelegateCommand ClearDataCommand =>
- _ClearDataCommand ?? ( _ClearDataCommand = new DelegateCommand(ExecuteClearDataCommand) );
- public void ExecuteClearDataCommand()
- {
- Draw_Module.ClearPrograms();
- }
- private DelegateCommand _RunProgramsCommand;
- public DelegateCommand RunProgramsCommand =>
- _RunProgramsCommand ?? ( _RunProgramsCommand = new DelegateCommand(ExecuteRunProgramsCommand) );
- public void ExecuteRunProgramsCommand()
- {
-
- Draw_Module.RunPrograms();
- }
- private DelegateCommand _StopProgramsCommand;
- public DelegateCommand StopProgramsCommand =>
- _StopProgramsCommand ?? ( _StopProgramsCommand = new DelegateCommand(ExecuteStopProgramsCommand) );
- public DrawModule Draw_Module { get => drawModule; set { SetProperty(ref drawModule, value); } }
- public void ExecuteStopProgramsCommand()
- {
- Draw_Module.StopPrograms();
- }
- }
- }
|