All docs
V21.2
21.2
21.1
20.2
20.1
The page you are viewing does not exist in version 20.1. This link will take you to the root page.
19.2
The page you are viewing does not exist in version 19.2. This link will take you to the root page.
19.1
The page you are viewing does not exist in version 19.1. This link will take you to the root page.
18.2
The page you are viewing does not exist in version 18.2. This link will take you to the root page.
18.1
The page you are viewing does not exist in version 18.1. This link will take you to the root page.
17.2
The page you are viewing does not exist in version 17.2. This link will take you to the root page.

RibbonGalleryItemThemePaletteSelectorBehavior Class

Populates the associated RibbonGalleryBarItem with the available palettes and allows you to choose the application theme’s palette.

Namespace: DevExpress.Xpf.Ribbon

Assembly: DevExpress.Xpf.Ribbon.v21.2.dll

Declaration

[TargetType(typeof(RibbonGalleryBarItem))]
public class RibbonGalleryItemThemePaletteSelectorBehavior :
    RibbonGalleryItemThemeSelectorBehavior

Remarks

Attach the RibbonGalleryItemThemePaletteSelectorBehavior to a RibbonGalleryBarItem in a RibbonControl to use it.

<dx:ThemedWindow
        x:Class="ThemeHelperWPF.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
        xmlns:dx="http://schemas.devexpress.com/winfx/2008/xaml/core"
        xmlns:dxr="http://schemas.devexpress.com/winfx/2008/xaml/ribbon"
        xmlns:dxmvvm="http://schemas.devexpress.com/winfx/2008/xaml/mvvm" 
        Title="MainWindow" Height="350" Width="525" 
        WindowKind="Ribbon" >
    <Grid>
        <dxr:RibbonControl x:Name="RibbonControl" DockPanel.Dock="Top">
            <dxr:RibbonDefaultPageCategory>
                <dxr:RibbonPage Caption="Home"/>
                <dxr:RibbonPage Caption="Settings" IsSelected="True">
                    <dxr:RibbonPageGroup Caption="Themes">
                        <dxr:RibbonGalleryBarItem>
                            <dxmvvm:Interaction.Behaviors>
                                <dxr:RibbonGalleryItemThemeSelectorBehavior ShowTouchThemes="False"/>
                            </dxmvvm:Interaction.Behaviors>
                        </dxr:RibbonGalleryBarItem>
                        <dxr:RibbonGalleryBarItem>
                            <dxmvvm:Interaction.Behaviors>
                                <dxr:RibbonGalleryItemThemePaletteSelectorBehavior />
                            </dxmvvm:Interaction.Behaviors>
                        </dxr:RibbonGalleryBarItem>
                    </dxr:RibbonPageGroup>
                </dxr:RibbonPage>
            </dxr:RibbonDefaultPageCategory>
        </dxr:RibbonControl>
    </Grid>
</dx:ThemedWindow>

RibbonGalleryThemeSelectorBehavior

View Example

Persist Theme Selection between Application Runs

You can save the application’s theme and palette to the configuration file and restore them on the next application run.

To save an applied theme and palette, use the static ApplicationThemeHelper.SaveApplicationThemeName method to save the theme name specified in the static ApplicationThemeHelper.ApplicationThemeName property:

private void Application_Exit(object sender, StartupEventArgs e) {
    ApplicationThemeHelper.SaveApplicationThemeName();
}        

Call the static ApplicationThemeHelper.UpdateApplicationThemeName method to retrieve the theme name from the configuration file and apply it to your application:

private void Application_Startup(object sender, ExitEventArgs e) {
    ApplicationThemeHelper.UpdateApplicationThemeName();
}

Inheritance

Show 13 items
Object
DispatcherObject
DependencyObject
Freezable
Animatable
DevExpress.Mvvm.UI.Interactivity.AttachableObjectBase
DevExpress.Mvvm.UI.Interactivity.Behavior
DevExpress.Mvvm.UI.Interactivity.Behavior<RibbonGalleryBarItem>
DevExpress.Xpf.Bars.ThemeSelectorBehavior<RibbonGalleryBarItem>
DevExpress.Xpf.Bars.BarItemThemeSelectorBehavior<RibbonGalleryBarItem>
DevExpress.Xpf.Bars.GalleryBarItemThemeSelectorBehavior<RibbonGalleryBarItem>
RibbonGalleryItemThemeSelectorBehavior
RibbonGalleryItemThemePaletteSelectorBehavior
See Also