/// <summary> /// Launch an icon/image selector dialog box and set the entity's icon to the result. /// </summary> /// <param name="sender">The changeIconButton.</param> /// <param name="eventArgs">The event arguments</param> private void OnChangeIconButtonClick(object sender, RoutedEventArgs eventArgs) { WindowIconChooser iconChooser = new WindowIconChooser(); iconChooser.Closed += this.OnIconChooserClosed; iconChooser.Show(); Win32Interop.DisableWindow(this); }
/// <summary> /// When the icon chooser window closes, get its selected icon (if any) and sets the entity's icon. /// </summary> /// <param name="sender">The icon chooser.</param> /// <param name="eventArgs">The event args.</param> private void OnIconChooserClosed(object sender, EventArgs eventArgs) { WindowIconChooser iconChooser = sender as WindowIconChooser; if (iconChooser.SelectedIconId != null) { this.Entity.ImageId = iconChooser.SelectedIconId.Value; this.Entity.ImageData = iconChooser.SelectedIcon.ImageData; if (!this.Populating) { this.isEntityDirty = true; } } Win32Interop.EnableWindow(this); this.Activate(); }