/// <summary> /// Handles the Click event of the uxMainMenuOptions control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void uxMainMenuOptions_Click(object sender, EventArgs e) { Trace.WriteLine("User requires options window...", "UI"); using (OptionsWindow options = new OptionsWindow { BackgroundColor = this.PreviewBackgroundColor, BackgroundColourPickedCallback = new Action<Color>(delegate(Color color) { Trace.WriteLine("User changes background color...", "UI"); this.PreviewBackgroundColor = color; this.uxEffectPreview.SetBackgroundColor(color.R, color.G, color.B); }), BackgroundImagePickedCallback = new Action<string>(delegate(string filePath) { Trace.WriteLine("User changes background image...", "UI"); this.uxEffectPreview.LoadBackgroundImage(filePath); }), BackgroundImageClearedCallback = new Action(delegate { Trace.WriteLine("User clears background image...", "UI"); this.uxEffectPreview.ClearBackgroundImage(); }), BackgroundImageOptionsCallback = new Action<ImageOptions>(delegate(ImageOptions imageOptions) { Trace.WriteLine("User changes background image layout...", "UI"); this.uxEffectPreview.ImageOptionsChanged(imageOptions); }), }) { options.ShowDialog(); } }
/// <summary> /// Handles the Click event of the uxMainMenuOptions control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param> private void uxMainMenuOptions_Click(object sender, EventArgs e) { using (OptionsWindow options = new OptionsWindow()) { options.BackgroundColor = this.PreviewBackgroundColor; options.BackgroundColourPickedCallback = new Action<Color>(delegate(Color color) { this.PreviewBackgroundColor = color; this.uxEffectPreview.SetBackgroundColor(color.R, color.G, color.B); }); options.BackgroundImagePickedCallback = new Action<string>(delegate(string filePath) { this.uxEffectPreview.LoadBackgroundImage(filePath); }); options.BackgroundImageClearedCallback = new Action(delegate { this.uxEffectPreview.ClearBackgroundImage(); }); options.BackgroundImageOptionsCallback = new Action<ImageOptions>(delegate(ImageOptions imageOptions) { this.uxEffectPreview.ImageOptionsChanged(imageOptions); }); options.ShowDialog(); } }