I have a tab page that should be hidden if a property (BlahType) is set to 1 and shown if set to 0. This is what I WANT to do:
<TabItem Header='Blah'> <TabItem.Triggers> <DataTrigger Binding='{Binding BlahType}' Value='0'> <Setter Property='TabItem.Visibility' Value='Hidden' /> </DataTrigger> </TabItem.Triggers> </TabItem>
The problem is, I get this error:
'Triggers collection members must be of type EventTrigger'
If you Google that error, you’ll see that Dr. WPF explains the error. Is there a clean way to do what I’m trying to achieve here?
I believe that the Triggers collection of a control only currently supports EventTriggers. If you would like to use a DataTrigger simply place it inside a style, for your example: