Skip to main content
Bar

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

ItemTriggerCondition.Binding Property

Gets or sets the binding that specifies the condition’s property.

Namespace: DevExpress.Xpf.Bars

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

NuGet Package: DevExpress.Wpf.Core

#Declaration

public BindingBase Binding { get; set; }

#Property Value

Type Description
BindingBase

The default value is null.

#Remarks

The following code sample sets the BarButtonItem‘s Foreground to Red when the BarButtonItem is located the MainMenu and the view model’s HighlightItemsInMenu property is true:

Bars - ItemTrigger Binding property

<dxb:BarButtonItem Content="Item">
    <dxb:BarButtonItem.Triggers>
        <dxb:ItemMultiTrigger>
            <dxb:ItemMultiTrigger.Conditions>
                <dxb:ItemTriggerCondition 
                    Binding="{Binding (dxb:BarItemLinkControlProperties.ContainerType), RelativeSource={RelativeSource Self}}" 
                    Value="MainMenu"/>
                <dxb:ItemTriggerCondition 
                    Binding="{Binding HighlightItemsInMenu}" 
                    Value="True"/>
            </dxb:ItemMultiTrigger.Conditions>
            <dxb:ItemSetter Property="Foreground" Value="Red"/>
        </dxb:ItemMultiTrigger>
    </dxb:BarButtonItem.Triggers>
</dxb:BarButtonItem>
using DevExpress.Mvvm;

public class ViewProperties : BindableBase {
    public bool HighlightItemsInMenu {
        get { return GetValue<bool>(); }
        set { SetValue(value); }
    }
}
public partial class MainWindow : DevExpress.Xpf.Core.ThemedWindow
    {
        public MainWindow()
        {
            DataContext = new ViewProperties() { HighlightItemsInMenu = true };
            InitializeComponent();
        }
    }
See Also