Event fired when item is added to ListView?

后端 未结 2 441
一向
一向 2021-01-13 08:21

I have this XAML:



        
2条回答
  •  半阙折子戏
    2021-01-13 09:00

    Setting the background of a ListViewItem directly is not a good idea because by default a ListView is virtualizing (which is good), that means the controls that make up the items get disposed when scrolled out of view. The easiest way to do this is that i can think of is having a property in your data-object which indicates the New-state, then you can trigger on it.

    
        
    
    

    You then can use any logic you want to set that value to false again if you do not consider it new anymore.

提交回复
热议问题