How to remove ListView's add item animation?

后端 未结 7 2227
攒了一身酷
攒了一身酷 2021-02-14 06:26

I have a ListView and I edited its ItemContainerStyle to modify some style but I don\'t know how to remove that annoying animation when you add an item

7条回答
  •  走了就别回头了
    2021-02-14 06:44

    These animations are called transitions and they are part of ListViewStyle. To change it right click on ListView control in the designer and select Edit Template > Edit a Copy.... This will add the built-in style to your XAML.

    The following part of the style is of interest to you:

    
        
            
                
                
                
                
            
        
    
    

    I'm not sure which animation exactly you dislike but try removing AddDeleteThemeTransition and/or EntranceThemeTransition from TransitionCollection. It should do the trick.

    Don't forget to make sure the modified style is applied to the desired ListView.

提交回复
热议问题