protected virtual void OnOverlayChanged(OverlayChangedOverlaySwitcherEventArgs e)
 {
     EventHandler<OverlayChangedOverlaySwitcherEventArgs> handler = OverlayChanged;
     if (handler != null)
     {
         handler(this, e);
     }
 }
Ejemplo n.º 2
0
        protected virtual void OnOverlayChanged(OverlayChangedOverlaySwitcherEventArgs e)
        {
            EventHandler <OverlayChangedOverlaySwitcherEventArgs> handler = OverlayChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }
        private void OverlaySwitcher_BaseOverlayChanged(object sender, OverlayChangedOverlaySwitcherEventArgs e)
        {
            BingMapsOverlay bingMapsOverlay = e.Overlay as BingMapsOverlay;

            if (bingMapsOverlay != null)
            {
                bool cancel = ApplyBingMapsKey();
                e.Cancel = cancel;
            }
        }
Ejemplo n.º 4
0
 private void ChangeBaseOverlay(OverlayItem item)
 {
     if (IsLoaded)
     {
         OverlayChangedOverlaySwitcherEventArgs overlaySwitchedEventArgs = new OverlayChangedOverlaySwitcherEventArgs(item.Overlay);
         OnOverlayChanged(overlaySwitchedEventArgs);
         if (overlaySwitchedEventArgs.Cancel)
         {
             BindingOverlays(activeOverlay);
         }
         else
         {
             activeOverlay = item.Overlay;
             foreach (Overlay overlay in CurrentMap.Overlays.Where(o => o.IsBase))
             {
                 overlay.IsVisible = activeOverlay == overlay;
             }
             CurrentMap.Refresh();
         }
     }
 }
 private void ChangeBaseOverlay(OverlayItem item)
 {
     if (IsLoaded)
     {
         OverlayChangedOverlaySwitcherEventArgs overlaySwitchedEventArgs = new OverlayChangedOverlaySwitcherEventArgs(item.Overlay);
         OnOverlayChanged(overlaySwitchedEventArgs);
         if (overlaySwitchedEventArgs.Cancel)
         {
             BindingOverlays(activeOverlay);
         }
         else
         {
             activeOverlay = item.Overlay;
             foreach (Overlay overlay in CurrentMap.Overlays.Where(o => o.IsBase))
             {
                 overlay.IsVisible = activeOverlay == overlay;
             }
             CurrentMap.Refresh();
         }
     }
 }
Ejemplo n.º 6
0
 private void OverlaySwitcher_BaseOverlayChanged(object sender, OverlayChangedOverlaySwitcherEventArgs e)
 {
     BingMapsOverlay bingMapsOverlay = e.Overlay as BingMapsOverlay;
     if (bingMapsOverlay != null)
     {
         bool cancel = ApplyBingMapsKey();
         e.Cancel = cancel;
     }
 }