[]
Occurs before applying the selected theme. Allows to cancel the theme applying.
[C1Category("Behavior")]
[C1Description("C1ThemePicker.ThemeApplying", "Occurs before applying the selected theme.")]
public event EventHandler<ThemeApplyingEventArgs> ThemeApplying
Type | Description |
---|---|
EventHandler<ThemeApplyingEventArgs> | Occurs before applying the selected theme. Allows to cancel the theme applying. |
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.
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
}