Back to Devexpress

ThemeManager.SetTheme(DependencyObject, Theme) Method

wpf-devexpress-dot-xpf-dot-core-dot-thememanager-dot-settheme-x28-system-dot-windows-dot-dependencyobject-devexpress-dot-xpf-dot-core-dot-theme-x29.md

latest3.0 KB
Original Source

ThemeManager.SetTheme(DependencyObject, Theme) Method

Sets the value of the ThemeManager.Theme attached property to a specified DependencyObject.

Namespace : DevExpress.Xpf.Core

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public static void SetTheme(
    DependencyObject obj,
    Theme value
)
vb
Public Shared Sub SetTheme(
    obj As DependencyObject,
    value As Theme
)

Parameters

NameTypeDescription
objDependencyObject

The element to which the attached property is written.

| | value | Theme |

The required theme.

|

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the SetTheme(DependencyObject, Theme) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

how-to-create-search-window-with-find-previous-and-find-next-buttons-in-gridcontrol-t127527/CS/DevExpress.Example01/SearchBehavior/SearchWindow.xaml.cs#L44

csharp
var theme = ThemeManager.GetTheme(this._Grid);
    ThemeManager.SetTheme(this, theme);
}

how-to-create-search-window-with-find-previous-and-find-next-buttons-in-gridcontrol-t127527/VB/DevExpress.Example01/SearchBehavior/SearchWindow.xaml.vb#L46

vb
Dim theme = ThemeManager.GetTheme(_Grid)
    ThemeManager.SetTheme(Me, theme)
End Sub

See Also

ThemeManager Class

ThemeManager Members

DevExpress.Xpf.Core Namespace