Esempio n. 1
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 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);
            }
        }