Alternative to Triggers on WP8

前端 未结 2 1242
陌清茗
陌清茗 2021-01-21 05:41

I\'ve read that Triggers are not supported in XAML for WP8. What\'s the alternative approach? I wanted to use a trigger to change the background image of a button w

2条回答
  •  旧巷少年郎
    2021-01-21 06:14

    Please try this. Windows phone triggers msdn

    Here I binded the image data trigger with my Boolean property , when the Boolean property is changed it will trigger and the setter will fire. Make sure you properties are implemented with INofityPropertyChanged

     xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions" x:Class="XXX_XXXX"
    
                    
                        
                            
                                
    
                                    
                                
                            
                        
                    
                
    

提交回复
热议问题