Creating a multi data trigger
A multi data trigger is the same as the data trigger, with the only difference being that you can set property values based on multiple conditions defined in the MultiDataTrigger.Conditions
. Property values are defined in the MultiDataTrigger.Setters
.
Let's learn about the multi data trigger usages in this recipe.
Getting ready
To get started with the multi data trigger, let's start by creating a project called CH06.MultiDataTriggerDemo
. Make sure you select the proper project template.
How to do it...
Follow these steps to create a UI with two checkboxes and a button, and then apply a multi data trigger to enable/disable the button, based on the check state:
- Let's begin by replacing the
Grid
with aStackPanel
, having two checkbox (chkLicense
andchkTerms
) controls and one button:
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"> <CheckBox x:Name="chkLicense" Content="Yes, I accept license agreement" /...