public OutputCoordinateViewModel() 
        {
            ConfigCommand = new RelayCommand(OnConfigCommand);
            ExpandCommand = new RelayCommand(OnExpandCommand);
            DeleteCommand = new RelayCommand(OnDeleteCommand);
            CopyCommand = new RelayCommand(OnCopyCommand);

            Mediator.Register(CoordinateToolLibrary.Constants.AddNewOutputCoordinate, OnAddNewOutputCoordinate);
            Mediator.Register(CoordinateToolLibrary.Constants.CopyAllCoordinateOutputs, OnCopyAllCoordinateOutputs);

            OutputCoordinateList = new ObservableCollection<OutputCoordinateModel>();
            DefaultFormatList = new ObservableCollection<DefaultFormatModel>();

            //for testing without a config file, init a few sample items
            //OutputCoordinateList = new ObservableCollection<OutputCoordinateModel>();
            ////var tempProps = new Dictionary<string, string>() { { "Lat", "70.49N" }, { "Lon", "40.32W" } };
            ////var mgrsProps = new Dictionary<string, string>() { { "GZone", "17T" }, { "GSquare", "NE" }, { "Northing", "86309" }, { "Easting", "77770" } };
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "DD", CType = CoordinateType.DD, OutputCoordinate = "70.49N 40.32W" });
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "DMS", CType = CoordinateType.DMS, OutputCoordinate = "40°26'46\"N,79°58'56\"W", Format = "A0°B0'C0\"N X0°Y0'Z0\"E" });
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "MGRS", CType = CoordinateType.MGRS, OutputCoordinate = @"", Format = "Z S X00000 Y00000" });
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "UTM", CType = CoordinateType.UTM, OutputCoordinate = @"", Format = "Z#H X0 Y0" });
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "GARS", CType = CoordinateType.GARS, OutputCoordinate = @"", Format = "X#YQK" });
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "USNG", CType = CoordinateType.USNG, OutputCoordinate = @"", Format = "Z S X0 Y0" });
            //OutputCoordinateList.Add(new OutputCoordinateModel { Name = "DDM", CType = CoordinateType.DDM, OutputCoordinate = @"", Format = "A0 B0.0### N X0 Y0.0### E" });

            //DefaultFormatList = new ObservableCollection<DefaultFormatModel>();

            //DefaultFormatList.Add(new DefaultFormatModel { CType = CoordinateType.DD, DefaultNameFormatDictionary = new SerializableDictionary<string, string> { { "70.49N 40.32W", "Y0.0#N X0.0#E" }, { "70.49N,40.32W", "Y0.0#N,X0.0#E" } } });

            //LoadOutputConfiguration();
        }
        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);
            }
        }
Exemplo n.º 4
0
        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 EditOutputCoordinateViewModel() 
        {
            if (System.Windows.Application.Current != null && System.Windows.Application.Current.MainWindow.Title.Contains("ArcGIS Pro"))
            {
                CategoryList = new ObservableCollection<string>() { "DD", "DDM", "DMS", "GARS", "MGRS", "USNG", "UTM" };
            }
            else
            {
                CategoryList = new ObservableCollection<string>() { "DD", "DDM", "DMS", "GARS", "MGRS", "USNG", "UTM" };
            }
            FormatList = new ObservableCollection<string>() { "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Custom" };
            Sample = "Sample";
            Format = "Y-+0.####,X-+0.####";

            FormatExpanded = false;

            Mediator.Register(CoordinateToolLibrary.Constants.BroadcastCoordinateValues, OnHandleBCCValues);
            Mediator.NotifyColleagues(CoordinateToolLibrary.Constants.RequestCoordinateBroadcast, null);

            ConfigCommand = new RelayCommand(OnConfigCommand);

            Mediator.Register(CoordinateToolLibrary.Constants.SpatialReferenceSelected, OnSpatialReferenceSelected);
        }