Skip to main content
All docs
V25.2
  • RibbonControl.PageHeaderButtonCommandParameter Property

    Gets or sets a parameter passed by the RibbonControl to the PageHeaderButtonCommand. This is a dependency property.

    Namespace: DevExpress.Xpf.Ribbon

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

    Declaration

    public object PageHeaderButtonCommandParameter { get; set; }

    Property Value

    Type Default Description
    Object null

    A value passed by the RibbonControl to the PageHeaderButtonCommand.

    Remarks

    Use PageHeaderButtonCommandParameter with PageHeaderButtonCommand. PageHeaderButtonCommandParameter allows you to control command behavior (for example, set a specific state explicitly instead of the predefined state switch operation).

    Example

    The following code example displays the Page Header Button in the header area:

    <dx:ThemedWindow
        x:Class="Demo.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:sys="clr-namespace:System;assembly=mscorlib"
        Title="MainWindow" Height="800" Width="800">
        <dx:ThemedWindow.Resources>
            <!-- Custom style for Page Header Button -->
            <Style TargetType="dxr:PageHeaderButton">
                <Setter Property="Margin" Value="5,0"/>
                <Setter Property="Padding" Value="8,4"/>
                <Setter Property="CornerRadius" Value="7"/>
                <Setter Property="GlyphWidth" Value="32"/>
                <Setter Property="GlyphHeight" Value="32"/>
                <Style.Triggers>
                    <Trigger Property="IsMouseOver" Value="True">
                        <Setter Property="Background" Value="#E3F2FD"/>
                    </Trigger>
                </Style.Triggers>
            </Style>
        </dx:ThemedWindow.Resources>
        <Grid>
            <dxr:RibbonControl
                RibbonStyle="Office2019"
                ShowPageHeaderButton="True"
                PageHeaderButtonToolTip="Show or hide navigation"
                PageHeaderButtonGlyph="pack://application:,,,/Icons/Hamburger.svg"
                PageHeaderButtonCommand="{Binding ToggleNavigationPanelCommand}"
                PageHeaderButtonCommandParameter="{x:Boolean True}" />
        </Grid>
    </dx:ThemedWindow>
    

    public sealed class MainViewModel {
        public bool IsNavigationVisible { get; set; } = false;
    
        public ICommand ToggleNavigationPanelCommand => new DevExpress.Mvvm.DelegateCommand<object>(p => {
            if (p is bool force)
                IsNavigationVisible = force;
            else
                IsNavigationVisible = !IsNavigationVisible; // Hides or displays the button if the parameter is null
        });
    }
    

    See Also