protected override async void OnClick()
        {
            Operation op = new MySampleOperation();

            // OPTION 1 = add the operation to a specific dockpane operation manager  (in this case, the sampleDockPane)
            DockPane pane = FrameworkApplication.DockPaneManager.Find(SampleDockPaneViewModel._dockPaneID);

            if (pane == null)
            {
                return;
            }

            SampleDockPaneViewModel vm = pane as SampleDockPaneViewModel;

            if (vm.OperationManager != null)
            {
                await vm.OperationManager.DoAsync(op);
            }


            // OR  OPTION 2 - add the operation to the active panes operation manager
            //Pane pane = FrameworkApplication.Panes.ActivePane;
            //if ((pane != null) && (pane.OperationManager != null))
            //    await pane.OperationManager.DoAsync(op);

            // OR  OPTION 3 - add the operation to the active maps operation manager
            //if ((MappingModule.ActiveMapView != null) && (MappingModule.ActiveMapView.Map != null))
            //    await MappingModule.ActiveMapView.Map.OperationManager.DoAsync(op);
        }
Пример #2
0
 protected override void OnClick()
 {
     SampleDockPaneViewModel.Show();
 }