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); } }
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(); } } }