In This Article

Native Controls

Actipro Themes includes styles and templates for all native WPF controls that have been given a more modernized appearance, and mesh perfectly with Actipro's custom control products.

The native WPF control styles use the same common asset resource (brush, thickness, etc.) pool as with our other custom WPF controls. Thus, no matter which native or Actipro controls you use together, the appearance will consistently look great.

Using Native Styles and Templates

The Style for each native control can be applied either explicitly or implicitly. In most situations, applying the styles implicitly is the best approach, as this provides consistency across your application.

Implicit Styles

The native control styles can be applied implicitly by simply setting ThemeManager.AreNativeThemesEnabled to true. The theme manager will automatically load the necessary implicit styles into the application resources, which will therefore be used by your entire application.

ThemeManager.AreNativeThemesEnabled = true;
Note

See the Getting Started topic for a complete example of how to use this setting, as well as how to combine it with other settings.

While not recommended due to additional resources needing to be loaded at run-time, it is also possible to implicitly apply the native control styles to part of the visual tree. This sample code shows how to enable native for myControl and its descendents only:

ThemeManager.SetAreNativeThemesEnabled(myControl, true);

Explicit Styles

The native control styles can also be applied explicitly on each individual control, using an associated ComponentResourceKey defined in the SharedResourceKeys class.

For example, the SharedResourceKeys.ButtonBaseStyleKey can be applied a RepeatButton like so:

xmlns:themes="http://schemas.actiprosoftware.com/winfx/xaml/themes"
...
<RepeatButton Content="Click Me" Style="{DynamicResource {x:Static themes:SharedResourceKeys.ButtonBaseStyleKey}}" />

For a complete list of the support native control styles, see the table in the following section.

Style Keys for Native Controls

This list shows the style resource keys that are available in SharedResourceKeys for use with native controls:

Style Resource Key Description

ButtonBaseStyleKey

Applies to ButtonBase controls and its derivations, which includes Button, RepeatButton, and ToggleButton.

CheckBoxStyleKey

Applies to CheckBox controls.

ComboBoxStyleKey

Applies to ComboBox controls.

ComboBoxItemStyleKey

Applies to ComboBoxItem controls.

ContextMenuStyleKey

Applies to ContextMenu controls.

DocumentViewerStyleKey

Applies to DocumentViewer controls.

ExpanderStyleKey

Applies to Expander controls. Note that this style uses expand/collapse animation by default, which can lead to performance issues while expanding/collapsing when there are an enormous number of elements within the expanded content. Set the attached ThemeProperties.IsAnimationEnabled dependency property to false on the Expander to prevent animation.

GridSplitterStyleKey

Applies to GridSplitter controls.

GridViewColumnHeaderStyleKey

Applies to GridViewColumnHeader controls.

GroupBoxStyleKey

Applies to GroupBox controls.

HyperlinkStyleKey

Applies to Hyperlink controls.

LabelStyleKey

Applies to Label.

ListBoxStyleKey

Applies to ListBox controls.

ListBoxItemStyleKey

Applies to ListBoxItem controls.

ListViewStyleKey

Applies to ListView controls.

ListViewItemStyleKey

Applies to ListViewItem controls.

MenuStyleKey

Applies to Menu controls.

MenuItemStyleKey

Applies to MenuItem controls. In addition, there are several keys that reference control templates for the various types of menu items:

PasswordBoxStyleKey

Applies to PasswordBox controls.

ProgressBarStyleKey

Applies to ProgressBar controls.

RadioButtonStyleKey

Applies to RadioButton controls.

ResizeGripStyleKey

Applies to ResizeGrip controls.

ScrollBarStyleKey

Applies to ScrollBar controls.

ScrollViewerStyleKey

Applies to ScrollViewer controls.

SeparatorStyleKey

Applies to Separator controls.

SliderStyleKey

Applies to Slider controls.

StatusBarStyleKey

Applies to StatusBar controls.

StatusBarItemStyleKey

Applies to StatusBarItem controls.

TabControlStyleKey

Applies to TabControl controls.

TabItemStyleKey

Applies to TabItem controls.

TextBoxBaseStyleKey

Applies to TextBoxBase controls and its derivations, which includes TextBox and RichTextBox.

ThumbStyleKey

Applies to Thumb controls.

ToolBarStyleKey

Applies to ToolBar controls.

ToolBarTrayStyleKey

Applies to ToolBarTray controls.

ToolTipStyleKey

Applies to ToolTip controls.

TreeViewStyleKey

Applies to TreeView controls.

TreeViewItemStyleKey

Applies to TreeViewItem controls and its derivations.

WindowStyleKey

Applies to Window controls.

Embedded Style Keys for Native Controls

Several native controls, such as ToolBar, require different styles for controls hosted or "embedded" inside it.

This list shows the embedded style resource keys that are available in SharedResourceKeys for use with Menu controls:

Style Resource Key Description
MenuEmbeddedScrollViewerStyleKey Applies to ScrollViewer controls.
MenuEmbeddedSeparatorStyleKey Applies to Separator controls.

StatusBar

This list shows the embedded style resource keys that are available in SharedResourceKeys for use with StatusBar controls:

Style Resource Key Description
StatusBarEmbeddedResizeGripStyleKey Applies to ResizeGrip controls.
StatusBarEmbeddedSeparatorStyleKey Applies to Separator controls.
StatusBarEmbeddedSliderDecreaseButtonBaseStyleKey Applies to ButtonBase controls and its derivations, which includes Button, RepeatButton, and ToggleButton.
StatusBarEmbeddedSliderIncreaseButtonBaseStyleKey Applies to ButtonBase controls and its derivations, which includes Button, RepeatButton, and ToggleButton.
StatusBarEmbeddedSliderStyleKey Applies to Slider controls.

ToolBar

This list shows the embedded style resource keys that are available in SharedResourceKeys for use with ToolBar controls:

Style Resource Key Description
ToolBarEmbeddedButtonBaseStyleKey Applies to ButtonBase controls and its derivations, which includes Button, RepeatButton, and ToggleButton.
ToolBarEmbeddedComboBoxStyleKey Applies to ComboBox controls.
ToolBarEmbeddedMenuStyleKey Applies to Menu controls.
ToolBarEmbeddedPopupButtonStyleKey Applies to PopupButton controls.
ToolBarEmbeddedSeparatorStyleKey Applies to Separator controls.
ToolBarEmbeddedTextBoxStyleKey Applies to TextBox controls.