public ManualValidationView(ManualValidationViewModel viewModel)
        {
            SetViewModel(viewModel);
            IsActiveContentChanged += new EventHandler(ManualValidationView_IsActiveContentChanged);

            InitializeComponent();
        }
Ejemplo n.º 2
0
 public void OnView(Result value)
 {
     ManualValidationViewModel viewModel = new ManualValidationViewModel(value, documentManager, _eventAggregator, labelAmountAlgorithm);
     ManagedContent view = _regionManager.FindExistingView(Regions.DocumentRegion.ToString(), typeof(ManualValidationView), "Validation Viewer");
     if (view == null)
     {
         view = new ManualValidationView(viewModel);
         _regionManager.AddToRegion(Regions.DocumentRegion.ToString(), view);
     }
     else
     {
         ((ManualValidationView)view).SetViewModel(viewModel);
     }
     view.Show();
     view.Activate();
 }
        public void SetViewModel(ManualValidationViewModel newViewModel)
        {
            if (viewModel != null)
            {
                viewModel.UpdateGraphs -= HandleUpdateGraphs;
                viewModel.Reprocess -= HandleReprocessing;
                viewModel.Unsubscribe();
            }

            viewModel = newViewModel;
            viewModel.UpdateGraphs += HandleUpdateGraphs;
            viewModel.Reprocess += HandleReprocessing;

            DataContext = viewModel;

            viewModel.RefreshPropertiesPanel();
        }