WPF Trigger binding to MVVM property

前端 未结 4 877
误落风尘
误落风尘 2020-12-31 11:10

I have a datatemplate containing an image that I want to be hidden if the the value of a property in a ViewModel is true. Can anyone tell me why the the xaml below does not

4条回答
  •  时光说笑
    2020-12-31 11:35

    isn't that

    
    

    ?

    I assume you use INotifyProptyChanged.

    EDIT I did some Googling and I think you need to use some sort of template in order to make the trigger work.

    eg.: http://social.msdn.microsoft.com/Forums/en-US/wpf/thread/ae2dbfb7-5dd6-4352-bfa1-53634289329d

    http://www.thejoyofcode.com/Help_Why_cant_I_use_DataTriggers_with_controls_in_WPF.aspx

提交回复
热议问题