Пример #1
0
        public MainWindowViewModel()
        {
            MakeRingRoiRequest = new InteractionRequest <MakeRingRoiNotification>();
            MakeRingRoiCommand = new DelegateCommand(RaiseMakeRingRoiInteraction);

            MakeWallRoiRequest = new InteractionRequest <MakeWallRoiNotification>();
            MakeWallRoiCommand = new DelegateCommand(RaiseMakeWallRoiInteraction);

            MakeRoiSubtractedRoiRequest = new InteractionRequest <MakeRoiSubtractedRoiNotification>();
            MakeRoiSubtractedRoiCommand = new DelegateCommand(RaiseMakeRoiSubtractedRoiInteraction);

            MakeMarginAddedRoiRequest = new InteractionRequest <MakeMarginAddedRoiNotification>();
            MakeMarginAddedRoiCommand = new DelegateCommand(RaiseMakeMarginAddedRoiInteraction);

            MakeOverlappedRoiRequest = new InteractionRequest <MakeOverlappedRoiNotification>();
            MakeOverlappedRoiCommand = new DelegateCommand(RaiseMakeOverlappedRoiInteraction);

            OkCommand     = new DelegateCommand(() => { RoiFormulas.CanExecute = true; RoiFormulas.WriteToFile(Path.Combine(DefaultDirectoryPath, DefaultFileName)); });
            CancelCommand = new DelegateCommand(() => { RoiFormulas.CanExecute = false; });

            ChooseFileCommand = new DelegateCommand(ChooseFile);
            SaveFileCommand   = new DelegateCommand(SaveFile);

            DeleteStructureFormulasCommand = new DelegateCommand(DeleteStructureFromulas);
        }
Пример #2
0
        public MainWindow(Dictionary <string, Dictionary <string, object> > structureDetails, RoiFormulas roiFormulas, string defaultDirectoryPath)
        {
            InitializeComponent();

            var viewModel = new ViewModels.MainWindowViewModel
            {
                RoiFormulas          = roiFormulas,
                StructureDetails     = structureDetails,
                StructureFormulas    = roiFormulas.Formulas,
                DefaultDirectoryPath = defaultDirectoryPath
            };

            this.DataContext = viewModel;
        }