Beispiel #1
0
 protected LayerSnapModesPaneViewModel()
 {
     //subscribe to events to populate snap layer list when the map changes, layers added/removed
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
     LayersAddedEvent.Subscribe(onLayersAddRem);
     LayersRemovedEvent.Subscribe(onLayersAddRem);
 }
        public ProLOSBaseViewModel()
        {
            ObserverOffset  = 2.0;
            TargetOffset    = 0.0;
            OffsetUnitType  = DistanceTypes.Meters;
            AngularUnitType = AngularTypes.DEGREES;

            ObserverAddInPoints = new ObservableCollection <AddInPoint>();

            ToolMode            = MapPointToolMode.Unknown;
            SurfaceLayerNames   = new ObservableCollection <string>();
            SelectedSurfaceName = string.Empty;

            Mediator.Register(VisibilityLibrary.Constants.DISPLAY_COORDINATE_TYPE_CHANGED, OnDisplayCoordinateTypeChanged);

            DeletePointCommand          = new RelayCommand(OnDeletePointCommand);
            DeleteAllPointsCommand      = new RelayCommand(OnDeleteAllPointsCommand);
            EditPropertiesDialogCommand = new RelayCommand(OnEditPropertiesDialogCommand);

            // subscribe to some mapping events
            ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
            LayersAddedEvent.Subscribe(OnLayersAdded);
            LayersRemovedEvent.Subscribe(OnLayersAdded);
            MapPropertyChangedEvent.Subscribe(OnMapPropertyChanged);
            MapMemberPropertiesChangedEvent.Subscribe(OnMapMemberPropertyChanged);
        }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        protected MainDockPaneViewModel()
        {
            // 選択ボタンを押すとExecuteSelectionTool()が実行される
            _selectionTool = new RelayCommand(() => ExecuteSelectionTool(), () => true);

            // DataDridをダブルクリックするとExecuteDataGridDoubleClick()が実行される
            _dataGridDoubleClick = new RelayCommand(() => ExecuteDataGridDoubleClick(), () => true);

            // レンダリング タブの実行ボタンを押すと ExecuteRenderingClick() が実行される
            _executeRendering = new RelayCommand(() => ExecuteRenderingClick(), () => true);

            // アノテーション タブの選択ボタンを押すと ExexuteAnnotationAngle() が実行される
            _annotationAngle = new RelayCommand(() => ExexuteAnnotationAngle(), () => true);
            // アノテーション タブの回転ボタンを押すと ExecuteRotateAnnotation() が実行される
            _rotateAnnotation = new RelayCommand(() => ExecuteRotateAnnotation(), () => true);
            // アノテーション タブのコピーボタンを押すと ExecuteCopyAnnotation() が実行される
            _copyAnnotation = new RelayCommand(() => ExecuteCopyAnnotation(), () => true);

            // ジオメトリ操作 [開く]を押すとアイテム選択ダイアログが表示される
            _openGdbCmd = new RelayCommand(() => OpenGdbDialog(), () => true);
            // 選択したポリゴンまたはラインにポイントを発生させるジオメトリ処理を行う
            _createPoint = new RelayCommand(() => ExecuteCreatePoint(), () => true);

            // イベントの登録
            ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
            LayersAddedEvent.Subscribe(OnLayerAdded);
            LayersRemovedEvent.Subscribe(OnLayerRemoved);
        }
 protected override bool Initialize()
 {
     //Subscribe to event to see if the Label gallery context is set
     ProjectOpenedEvent.Subscribe(OnProjectOpened);
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
     DrawCompleteEvent.Subscribe(OnDrawComplete);
     LayersAddedEvent.Subscribe(OnLayersAdded);
     return(base.Initialize());
 }
Beispiel #5
0
        protected override Task InitializeAsync()
        {
            ProjectItemsChangedEvent.Subscribe(OnProjectCollectionChanged);
            ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChangedEvent);

            LayersAddedEvent.Subscribe(OnLayersAddedEvent);
            LayersRemovedEvent.Subscribe(OnLayersRemovedEvent);

            return(base.InitializeAsync());
        }
Beispiel #6
0
        /// <summary>
        /// Combo Box constructor
        /// </summary>
        public DEMCombo()
        {
            Parameter.DEMCombo = this;
            LayersAddedEvent.Subscribe(UpdateCombo);
            LayersMovedEvent.Subscribe(UpdateCombo);
            LayersRemovedEvent.Subscribe(UpdateCombo);
            ActiveMapViewChangedEvent.Subscribe(UpdateCombo);

            UpdateCombo(null);
        }
Beispiel #7
0
 /// <summary>
 /// Funzione da richiamare allo scattare dell'evento 'Chiusura Mappa'.
 /// </summary>
 /// <param name="args"></param>
 private void AllaChiusuraMappa(MapClosedEventArgs args)
 {
     this.Clear();
     this.UpdateCombo();
     LayersAddedEvent.Unsubscribe(EventoLayerInTOC);
     LayersMovedEvent.Unsubscribe(EventoLayerInTOC);
     LayersRemovedEvent.Unsubscribe(EventoLayerInTOC);
     //MapPropertyChangedEvent.Unsubscribe(AllaVariazioneProprietaMappa); // Occurs when any property of a map is changed.
     MapMemberPropertiesChangedEvent.Unsubscribe(EventoLayerInTOC);
 }
 private void AddEvents()
 {
     LayersAddedEvent.Subscribe(OnLayersAdded);
     LayersMovedEvent.Subscribe(OnLayersMoved);
     LayersRemovedEvent.Subscribe(OnLayersRemoved);
     MapMemberPropertiesChangedEvent.Subscribe(OnMapMemberPropertiesChanged);
     TOCSelectionChangedEvent.Subscribe(OnTocSelectionChanged);
     DrawStartedEvent.Subscribe(OnDrawStarted);
     DrawCompleteEvent.Subscribe(OnDrawCompleted);
     ActiveToolChangedEvent.Subscribe(OnActiveToolChangedEvent);
     EditCompletedEvent.Subscribe(OnEditCompleted);
 }
 protected FeatureSelectionDockPaneViewModel()
 {
     System.Windows.Data.BindingOperations.EnableCollectionSynchronization(_layers, _lock);
     System.Windows.Data.BindingOperations.EnableCollectionSynchronization(_layerSelection, _lock);
     System.Windows.Data.BindingOperations.EnableCollectionSynchronization(_fieldAttributes, _lock);
     LayersAddedEvent.Subscribe(OnLayersAdded);
     LayersRemovedEvent.Subscribe(OnLayersRemoved);
     ActiveToolChangedEvent.Subscribe(OnActiveToolChanged);
     MapSelectionChangedEvent.Subscribe(OnSelectionChanged);
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
     MapRemovedEvent.Subscribe(OnMapRemoved);
 }
Beispiel #10
0
        /// <summary>
        /// Combo Box constructor
        /// </summary>
        public ComboBoxFeatureLayer()
        {
            mappa = ProAddInSR.funzioniVariabiliGlobali.FunzioniGlobali.RicavaMappaAttiva();
            UpdateCombo();

            MapViewInitializedEvent.Subscribe(OnMapViewCaricata); // Occurs when the map view has initialized --> Cioè aperta nuova Mappa, e caricata da zero!!
            LayersAddedEvent.Subscribe(EventoLayerInTOC);
            LayersMovedEvent.Subscribe(EventoLayerInTOC);
            LayersRemovedEvent.Subscribe(EventoLayerInTOC);
            MapClosedEvent.Subscribe(AllaChiusuraMappa);
            MapPropertyChangedEvent.Subscribe(AllaVariazioneProprietaMappa); // Occurs when any property of a map is changed.
            MapMemberPropertiesChangedEvent.Subscribe(EventoLayerInTOC);     // Occurs when any property of layer or standalone table changed.
        }
Beispiel #11
0
        private void OnMapViewCaricata(MapViewEventArgs args)
        {
            funzioniVariabiliGlobali.VariabiliGlobali.blnMappaAttivaCaricata = true;
            this.Clear();
            this.UpdateCombo();

            LayersAddedEvent.Subscribe(EventoLayerInTOC);
            LayersMovedEvent.Subscribe(EventoLayerInTOC);
            LayersRemovedEvent.Subscribe(EventoLayerInTOC);
            MapClosedEvent.Subscribe(AllaChiusuraMappa);
            MapPropertyChangedEvent.Subscribe(AllaVariazioneProprietaMappa); // Occurs when any property of a map is changed.
            MapMemberPropertiesChangedEvent.Subscribe(EventoLayerInTOC);     // Occurs when any property of layer or standalone table changed.
        }
        protected InspectorSettingsViewModel()
        {
            _getMapsCommand = new RelayCommand(() => GetMaps(), () => true);

            Utilities.ProUtilities.RunOnUiThread(() =>
            {
                BindingOperations.EnableCollectionSynchronization(_maps, _lockCollection);
                BindingOperations.EnableCollectionSynchronization(_layers, _lockCollection);
            });

            LayersAddedEvent.Subscribe(OnLayerAdded, false);
            LayersRemovedEvent.Subscribe(OnLayerRemoved, false);
            ProjectOpenedEvent.Subscribe(OnProjectOpened, false);
        }
Beispiel #13
0
 protected override void OnUpdate()
 {
     // Set button status when status of ArcGIS Earth or ArcGIS Pro changed.
     if (ToolHelper.IsArcGISEarthRunning && ToolHelper.IsArcGISProGlobalSceneOpening)
     {
         Enabled = true;
     }
     else
     {
         // Unsubscribe events of adding layer and elevation source.
         LayersAddedEvent.Unsubscribe(AddLayerToEarth);
         Enabled   = false;
         IsChecked = false;
     }
 }
Beispiel #14
0
 protected override void OnClick()
 {
     if (IsChecked)
     {
         // Unsubscribe events of adding layer and elevation source.
         LayersAddedEvent.Unsubscribe(AddLayerToEarth);
         IsChecked = false;
     }
     else
     {
         // Subscribe events of adding layer and elevation source.
         LayersAddedEvent.Subscribe(AddLayerToEarth, false);
         IsChecked = true;
     }
 }
 protected override void OnUpdate()
 {
     // Set button status when status of connecting to ArcGIS Earth changed.
     if (ToolHelper.IsConnectSuccessfully)
     {
         Enabled = true;
     }
     else
     {
         // Unsubscribe events of adding layer and elevation source.
         LayersAddedEvent.Unsubscribe(AddLayerToEarth);
         Enabled   = false;
         IsChecked = false;
     }
 }
        private async void OnMapClosed(MapClosedEventArgs args)
        {
            LayersAddedEvent.Unsubscribe(OnLayersAdded);
            LayersMovedEvent.Unsubscribe(OnLayersMoved);
            LayersRemovedEvent.Unsubscribe(OnLayersRemoved);
            MapMemberPropertiesChangedEvent.Unsubscribe(OnMapMemberPropertiesChanged);
            TOCSelectionChangedEvent.Unsubscribe(OnTocSelectionChanged);
            ActiveToolChangedEvent.Unsubscribe(OnActiveToolChangedEvent);
            EditCompletedEvent.Unsubscribe(OnEditCompleted);
            DrawCompleteEvent.Unsubscribe(OnDrawCompleted);
            DrawStartedEvent.Unsubscribe(OnDrawStarted);

            while (Count >= 1)
            {
                VectorLayer vectorLayer = this[0];
                await RemoveLayer(vectorLayer);
            }
        }
Beispiel #17
0
 protected SymbolsViewModel()
 {
     SearchPauseSearching = true;
     #region Events
     //Subscribe to ProjectItemsChangedEvent to update ProjecyStyles
     ProjectItemsChangedEvent.Subscribe(OnProjectItemsChanged);
     ProjectClosedEvent.Subscribe(OnProjectClosed);
     //Subscribe to ActiveMapViewChangedEvent in order to get the layers in the map
     ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
     LayersAddedEvent.Subscribe(OnLayersAdded);
     LayersRemovedEvent.Subscribe(OnLayersemoved);
     //Subscribe to Graphic Elements selection changed event
     ElementSelectionChangedEvent.Subscribe(OnGraphicsElementSelectionChanged);
     #endregion
     BindingOperations.EnableCollectionSynchronization(_layersInMap, _layersInMapLock);
     _           = GetLayersInMapAsync();
     _patchTypes = new Dictionary <StyleItemType, SymbolPatchType>
     {
         { StyleItemType.LineSymbol, SymbolPatchType.ZigzagLine },
         { StyleItemType.PolygonSymbol, SymbolPatchType.BoundaryPoly }
     };
     //Get the Styles in the project
     ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(true));
     ProjectFilterStyles.Add(new SymbolSearcherSearchFilter());
     foreach (var pi in Project.Current.GetItems <StyleProjectItem>())
     {
         ProjectFilterStyles.Add(new SymbolSearcherSearchFilter(false, pi));
     }
     if (SelectedProjectFilterStyle == null && ProjectFilterStyles.Count > 0)
     {
         SelectedProjectFilterStyle = ProjectFilterStyles[0];
     }
     //Get the various StyleItemTypes in Pro.
     foreach (StyleItemType sit in Enum.GetValues(typeof(StyleItemType)))
     {
         if (sit == 0)
         {
             continue;
         }
         StyleItemTypeValues.Add(sit);
     }
     SelectedStyleItemType = StyleItemTypeValues.FirstOrDefault();
     SearchPauseSearching  = false;
 }
        /// <summary>
        /// コンストラクタ
        /// </summary>
        protected MainDockPaneViewModel()
        {
            // 選択ボタンを押すとExecuteSelectionTool()が実行される
            _selectionTool = new RelayCommand(() => ExecuteSelectionTool(), () => true);

            // DataDridをダブルクリックするとExecuteDataGridDoubleClick()が実行される
            _dataGridDoubleClick = new RelayCommand(() => ExecuteDataGridDoubleClick(), () => true);

            // レンダリング タブの実行ボタンを押すと ExecuteRenderingClick() が実行される
            _executeRendering = new RelayCommand(() => ExecuteRenderingClick(), () => true);

            // アノテーション タブの選択ボタンを押すと ExexuteAnnotationAngle() が実行される
            _annotationAngle = new RelayCommand(() => ExexuteAnnotationAngle(), () => true);
            // アノテーション タブの回転ボタンを押すと ExecuteRotateAnnotation() が実行される
            _rotateAnnotation = new RelayCommand(() => ExecuteRotateAnnotation(), () => true);
            // アノテーション タブのコピーボタンを押すと ExecuteCopyAnnotation() が実行される
            _copyAnnotation = new RelayCommand(() => ExecuteCopyAnnotation(), () => true);

            // イベントの登録
            ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChanged);
            LayersAddedEvent.Subscribe(OnLayerAdded);
            LayersRemovedEvent.Subscribe(OnLayerRemoved);
        }
        // Constructor
        protected FileTileLoaderViewModel()
        {
            _saveFolder   = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"RemoteSensing\ArcPro\FileTileLoader");
            _saveFullPath = System.IO.Path.Combine(_saveFolder, _saveFile);

            _getMapsCommand          = new RelayCommand(() => GetMaps(), () => true);
            _loadFileCommand         = new RelayCommand(() => LoadFiles(), () => true);
            _getFileWorkspaceCommand = new RelayCommand(() => GetFileWorkspace(), () => true);

            Utilities.ProUtilities.RunOnUiThread(() =>
            {
                BindingOperations.EnableCollectionSynchronization(_maps, _lockCollection);
                BindingOperations.EnableCollectionSynchronization(_featureLayers, _lockCollection);
                BindingOperations.EnableCollectionSynchronization(_fields, _lockCollection);
                BindingOperations.EnableCollectionSynchronization(_fileExtensions, _lockCollection);
            });

            LayersAddedEvent.Subscribe(OnLayersAdded, false);
            LayersRemovedEvent.Subscribe(OnLayersRemoved, false);
            ProjectOpenedEvent.Subscribe(OnProjectOpened, false);

            ReadFileExtensionsFromDisk();
        }