void XDeviceAdded(object sender, DeviceAddedEventArgs e) { UISafeCall(() => { LogAppend("XDeviceAdded: ", e.Device.HostName); var gp = new GlimPanel { Device = e.Device }; gp.Click += (s, e2) => SelectGlimPanel(s as GlimPanel); cDevices.Controls.Add(gp); }); }
void SelectGlimPanel(GlimPanel gp) { foreach (GlimPanel od in cDevices.Controls) { od.SelectedAppearance = false; } if (cDetailsGrid is INotifyPropertyChanged) { (cDetailsGrid as INotifyPropertyChanged).PropertyChanged -= GlimDatGridPropertyChanged; } var p = gp.GetDataGridObject(); cDetailsGrid.SelectedObject = p; p.PropertyChanged += GlimDatGridPropertyChanged; gp.SelectedAppearance = true; }