In my silverlight application I use a data grid. I have a column with session started time and a column with elapsed time. The elapsed time is "total minutes : seconds". In my mo开发者_JAVA百科del I have a property ElapsedTimeDisplay that compute and transform the elapsed time into a string. How can update that each second? Is there any possibility to update only that column? Is there any other possibility of achieving this without using a trigger?
This depends on your setup, it could be as easy as adding a timer in your ViewModel (or maybe your model) that ticks every second, and raise the PropertyChanged
event on the ElapsedTimeDisplay
(which I suppose does the calculation in the getter). To do this, you need to have your ViewModel (or model) implement INotifyPropertyChanged
.
Hope this helps :)
精彩评论