Basic Library for WPF and Silverlight | ComponentOne
In This Topic
    Clear Style Properties
    In This Topic

    ClearStyle technology is a new, quick and easy approach to providing Silverlight and WPF control styling. ClearStyle allows you to create a custom style for a control without having to deal with the hassle of XAML templates and style resources.

    Currently, to add a theme to all standard WPF controls, you must create a style resource template. In Microsoft Visual Studio this process can be difficult; this is why Microsoft introduced Expression Blend to make the task a bit easier. Having to jump between two environments can be a bit challenging to developers who are not familiar with Blend or do not have the time to learn it. You could hire a designer, but that can complicate things when your designer and your developers are sharing XAML files.

    That's where ClearStyle comes in. With ClearStyle the styling capabilities are brought to you in Visual Studio in the most intuitive manner possible. In most situations you just want to make simple styling changes to the controls in your application so this process should be simple. For example, if you just want to change the row color of your data grid this should be as simple as setting one property. You shouldn't have to create a full and complicated-looking template just to simply change a few colors.

    Each key piece of the control's style is surfaced as a simple color property. This leads to a unique set of style properties for each control. For example, a Gauge has PointerFill and PointerStroke properties, whereas a DataGrid has SelectedBrush and MouseOverBrush for rows.

    Let's say you have a control on your form that does not support ClearStyle. You can take the XAML resource created by ClearStyle and use it to help mold other controls on your form to match (such as grabbing exact colors). Or let's say you'd like to override part of a style set with ClearStyle (such as your own custom scrollbar). This is also possible because ClearStyle can be extended and you can override the style where desired.

    ClearStyle is intended to be a solution to quick and easy style modification but you're still free to do it the old fashioned way with ComponentOne's controls to get the exact style needed. ClearStyle does not interfere with those less common situations where a full custom design is required.

    The following table lists all of the ClearStyle-supported properties in the C1DropDown control as well as a description of the property:

     

    Property Description
    Background Gets or sets a brush that describes the background of a control. The default Background color is White.
    FocusBrush A brush used to define the appearance of the control, when the control is in focus.
    MouseOverBrush A brush used to define the appearance of the control, when the control is in moused over.
    PressedBrush A brush used to define the appearance of the control, when the control is selected.