Table of Contents
- Getting Started
- EO.Pdf
- EO.Web
- EO.WebBrowser
- EO.Wpf
- Overview
- Installation & Deployement
- Skin & Theme
- Common Taskes and Services
- EO.Wpf Buttons
- EO.Wpf Calendar & DatePicker
- EO.Wpf ComboBox
- EO.Wpf DockView
- EO.Wpf Gauge
- EO.Wpf ListBox
- EO.Wpf Menu
- EO.Wpf MaskedEdit
- EO.Wpf ProgressBar
- EO.Wpf Slider
- EO.Wpf SpinEdit
- EO.Wpf SplitView
- EO.Wpf TabControl
- EO.Wpf TreeView
- EO.Wpf Utility Controls
- EO.Wpf WindowChrome
- Sample Data Objects
- Common Topics
- Reference
Custom Skin/Theme for Your Own Control |
EO.Wpf can extend theme support to non-EO controls. There are two ways to extend theme support to controls not provided by EO.Wpf:
- Register the control with EO.Wpf.ThemeManager; - OR -
- Monitor EO.Wpf theme/skin changes, then apply styles based on the current theme or skin of an EO.Wpf control;
This topic covers the first method. The second method is covered here.
In order for a control to support themes, you must first declare and register theme styles following steps described here, then register the control with EO.Wpf ThemeManager with the following code:
//Register a control with EO.Wpf.ThemeManager
ThemeManager.Register(control);
It is recommended that you call this code either inside the FrameworkElement's Initialized event handler, or overrides its OnInitialized method. For example:
public class CustomControl: BaseControl { .... protected override void OnInitialized(EventArgs e) { //Register this control with EO.Wpf ThemeManager ThemeManager.Register(this); base.OnInitialized(e); } .... }
Once the control is registered with the ThemeManager, the ThemeManager will automatically switches style for the control based on the value of ThemeManager.ThemeName or ThemeManager.SkinName attached property.