private async void OnMapViewInitialized(MapViewEventArgs args)
        {
            CycloMediaLayer.ResetYears();
            LayersRemovedEvent.Subscribe(OnLayerRemoved);
            DrawCompleteEvent.Subscribe(OnDrawComplete);

            if (ContainsCycloMediaLayer(args.MapView))
            {
                await AddLayersAsync(args.MapView);
            }

            Settings settings = Settings.Instance;
            Login    login    = Login.Instance;

            settings.PropertyChanged += OnSettingsPropertyChanged;
            login.PropertyChanged    += OnLoginPropertyChanged;

            if (settings.CycloramaViewerCoordinateSystem != null)
            {
                await CoordSystemUtils.CheckInAreaCycloramaSpatialReferenceAsync();
            }

            if (!_agreement.Value)
            {
                PropertySheet.ShowDialog("streetSmartArcGISPro_optionsPropertySheet", "streetSmartArcGISPro_agreementPage");
            }
        }
        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);
        }
示例#4
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);
 }
示例#5
0
        protected override Task InitializeAsync()
        {
            ProjectItemsChangedEvent.Subscribe(OnProjectCollectionChanged);
            ActiveMapViewChangedEvent.Subscribe(OnActiveMapViewChangedEvent);

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

            return(base.InitializeAsync());
        }
示例#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);
        }
 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);
 }
 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);
 }
示例#9
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.
        }
示例#10
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);
        }
 protected override void OnClick()
 {
     if (IsChecked)
     {
         // Unsubscribe RemoveLayerFromEarth and set button status.
         LayersRemovedEvent.Unsubscribe(RemoveLayerFromEarth);
         IsChecked = false;
     }
     else
     {
         // Subscribe RemoveLayerFromEarth and set button status.
         LayersRemovedEvent.Subscribe(RemoveLayerFromEarth, false);
         IsChecked = true;
     }
 }
示例#13
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;
 }
        // 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();
        }
        /// <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);
        }