protected CoordinateToolDockpaneViewModel() { _coordinateToolView = new CoordinateToolView(); HasInputError = false; AddNewOCCommand = new CoordinateToolLibrary.Helpers.RelayCommand(OnAddNewOCCommand); ActivatePointToolCommand = new CoordinateToolLibrary.Helpers.RelayCommand(OnMapToolCommand); FlashPointCommand = new CoordinateToolLibrary.Helpers.RelayCommand(OnFlashPointCommand); CopyAllCommand = new CoordinateToolLibrary.Helpers.RelayCommand(OnCopyAllCommand); Mediator.Register(CoordinateToolLibrary.Constants.RequestCoordinateBroadcast, OnBCNeeded); InputCoordinateHistoryList = new ObservableCollection<string>(); MapSelectionChangedEvent.Subscribe(OnSelectionChanged); var ctvm = CTView.Resources["CTViewModel"] as CoordinateToolViewModel; if (ctvm != null) { ctvm.SetCoordinateGetter(proCoordGetter); } }
public MainViewModel() { _coordinateToolView = new CoordinateToolView(); HasInputError = false; AddNewOCCommand = new RelayCommand(OnAddNewOCCommand); ActivatePointToolCommand = new RelayCommand(OnActivatePointToolCommand); FlashPointCommand = new RelayCommand(OnFlashPointCommand); CopyAllCommand = new RelayCommand(OnCopyAllCommand); ExpandCommand = new RelayCommand(OnExpandCommand); Mediator.Register(CoordinateToolLibrary.Constants.RequestCoordinateBroadcast, OnBCNeeded); InputCoordinateHistoryList = new ObservableCollection<string>(); // update tool view model var ctvm = CTView.Resources["CTViewModel"] as CoordinateToolViewModel; if (ctvm != null) { ctvm.SetCoordinateGetter(amCoordGetter); } }