protected override void OnClick() { if (_isOpen) return; _isOpen = true; _dlg = new CoordSysDialog(); _dlg.Closing += bld_Closing; _dlg.Owner = FrameworkApplication.Current.MainWindow; _dlg.Show(); }
void bld_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_dlg.SpatialReference != null) { MessageBox.Show(string.Format("You picked {0}", _dlg.SpatialReference.Name), "Pick Coordinate System"); //Do something with the selected spatial reference //.... } _dlg = null; _isOpen = false; }
private void bld_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (_dlg.SpatialReference != null) { System.Windows.MessageBox.Show(string.Format("You picked {0}", _dlg.SpatialReference.Name), "Pick Coordinate System"); Mediator.NotifyColleagues(CoordinateToolLibrary.Constants.SpatialReferenceSelected, string.Format("{0}::{1}", _dlg.SpatialReference.Wkid, _dlg.SpatialReference.Name)); } _dlg = null; _isOpen = false; }
public override bool SelectSpatialReference() { if (_isOpen) return false; _isOpen = true; _dlg = new CoordSysDialog(); _dlg.Closing += bld_Closing; _dlg.Show(); return false; }