WPF Trigger based on Object Type

前端 未结 5 936
自闭症患者
自闭症患者 2020-12-13 17:27

Is there a way to do a comparison on object type for a trigger?


         


        
5条回答
  •  天涯浪人
    2020-12-13 18:13

    Using a converter as suggested by AndyG is a good option. Alternatively, you could also use a different DataTemplate for each target type. WPF will automatically pick the DataTemplate that matches the object type

提交回复
热议问题