开发者

Silverlight datagrid elapsed time cell

开发者 https://www.devze.com 2023-03-12 00:03 出处:网络
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

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 :)

0

精彩评论

暂无评论...
验证码 换一张
取 消