[]
        
(Showing Draft Content)

C1.Win.C1Themes.C1ThemePicker.ThemeApplying

ThemeApplying Event

Occurs before applying the selected theme. Allows to cancel the theme applying.

Namespace: C1.Win.C1Themes
Assembly: C1.Win.C1Themes.Extended.4.8.dll
Syntax
[C1Category("Behavior")]
[C1Description("C1ThemePicker.ThemeApplying", "Occurs before applying the selected theme.")]
public event EventHandler<ThemeApplyingEventArgs> ThemeApplying
Returns
Type Description
EventHandler<ThemeApplyingEventArgs> Occurs before applying the selected theme. Allows to cancel the theme applying.
Remarks

This event fires after a theme name is assigned or selected in the drop-down list, and allows the program to cancel the theme apply to form controls, if necessary.

Examples

The code below handles the ThemeApplying event after theme name was assigned. As a result, the theme name was assigned to SelectedThemeName property, but the theme was not applied on the form due to "e.Handled = true".

var c1ThemePicker1 = new C1ThemePicker();
c1ThemePicker1.ThemeApplying += c1ThemePicker1_ThemeApplying;

c1ThemePicker1.SelectedThemeName = "BeigeOne"; // assign theme name

private void c1ThemePicker1_ThemeApplying(object sender, ThemeApplyingEventArgs e)
{
    var themeName = e.ThemeName; // is "BeigeOne"
    e.Handled = true;            // The theme will not be applied to the form controls
}