示例#1
0
 private void OverlayChecked(object sender, RoutedEventArgs e)
 {
     if (IsLoaded)
     {
         KeyValuePair <Overlay, bool> keyValuePair = (KeyValuePair <Overlay, bool>)((RadioButton)sender).DataContext;
         var overlaySwitchedEventArgs = new OverlaySwitchedEventArgs(keyValuePair.Key);
         OnOverlaySwitched(overlaySwitchedEventArgs);
         if (overlaySwitchedEventArgs.IsCancel)
         {
             BindingOverlays(checkedOverlay);
         }
         else
         {
             checkedOverlay = keyValuePair.Key;
             foreach (var overlay in wpfMap.Overlays)
             {
                 if (overlay.IsBase)
                 {
                     overlay.IsVisible = checkedOverlay == overlay;
                 }
             }
             wpfMap.Refresh();
         }
     }
 }
 protected virtual void OnOverlaySwitched(OverlaySwitchedEventArgs e)
 {
     EventHandler<OverlaySwitchedEventArgs> handler = OverlaySwitched;
     if (handler != null)
     {
         handler(this, e);
     }
 }
示例#3
0
        protected virtual void OnOverlaySwitched(OverlaySwitchedEventArgs e)
        {
            EventHandler <OverlaySwitchedEventArgs> handler = OverlaySwitched;

            if (handler != null)
            {
                handler(this, e);
            }
        }
 private void OverlayChecked(object sender, RoutedEventArgs e)
 {
     if (IsLoaded)
     {
         KeyValuePair<Overlay, bool> keyValuePair = (KeyValuePair<Overlay, bool>)((RadioButton)sender).DataContext;
         var overlaySwitchedEventArgs = new OverlaySwitchedEventArgs(keyValuePair.Key);
         OnOverlaySwitched(overlaySwitchedEventArgs);
         if (overlaySwitchedEventArgs.IsCancel)
         {
             BindingOverlays(checkedOverlay);
         }
         else
         {
             checkedOverlay = keyValuePair.Key;
             foreach (var overlay in wpfMap.Overlays)
             {
                 if (overlay.IsBase)
                 {
                     overlay.IsVisible = checkedOverlay == overlay;
                 }
             }
             wpfMap.Refresh();
         }
     }
 }