Silverlight datagrid elapsed time cell - silverlight

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

Related

Event time window in Flink does not trigger

When I use flink event time window, the window just doesn't trigger. How can I solve the problem, and are there any ways to debug?
As you are using the event time window, it is probably a watermark problem. The window only output when watermarks make a progress. There are some reasons why the event time has not been advanced:
There are no data from the source
One of the source parallelisms doesn't have data
The time field extracted from the record should be millisecond instead of second.
Data should cover a longer time span than the window size to advance the event time.
The window will output if we change event time to processing time. Furthermore, we can monitor event time by checking the watermarks in the web dashboard[1] or print-debug it with a ProcessFunction which can lookup the current watermark.
[1] https://ci.apache.org/projects/flink/flink-docs-master/monitoring/debugging_event_time.html#monitoring-current-event-time
Be sure you're setting environment.setStreamTimeCharacteristic(TimeCharacteristic.EventTime).

Measuring time for WPF Databinding processing

I am to evaluate several competing frameworks for WPF components which process large amounts of data (100000 entries and up). Thus, I need to time the real performance. As all our software is strictly MVVM/Data binding driven, that is the test environment I use. What I need is to find a way to measure time between my view model sets some value and the end of rendering by the view. Visually it takes several seconds, but I'd like to have exact measurements.
I can of course start a stopwatch when setting the property, but how do I find out that the rendering is ready? Is there an event or something for this?
Maybe it won't give you exact measures, but an easy way to do it is using the Dispatcher
var sw = new StopWatch();
sw.Start();
//Set value and raise property changed
Dispatcher.CurrentDispatcher.BeginInvoke((Action)(() =>
{
sw.Stop();
}), System.Windows.Threading.DispatcherPriority.Loaded);
The Loaded priority is just below the Render priority, so the stopwatch will be stopped after the view has been rendered.

Which is faster to use binding using converter or update in a property changed callback?

I need fast updates, so I was wondering which one is faster and more efficient.
I performed some measurements, and can proclaim, that using a converter in a binding is cheaper than not using it. We're talking about 9% time saving.
Probably, finding / creating a default converter takes more time than taking an instance of a converter from a resource...

Updating DataGrid Info in Silverlight

I have a Silverlight 4 application that uses a DataGrid. This DataGrid is bound to a List of approximately 1,000 records. One of the columns on this grid is dynamic in the sense that it should update once every thirty seconds.
I have a DispatcherTimer setup that is triggered every 30 seconds. My question is, what is the best way for me to update the values of just that one column?
Thank you!
Make each dataitem representing the row implementing INotifyPropertyChanged, and raise the event when you update the column value. This should work by displayng the canges as soon as you update the variable.

Silverlight 4 Datagrid Sorting

I'm having a heck of a time trying to get a silverlight datagrid to properly sort, and do so quickly (sub 1/10 second). Here's the scenario:
-WCF callback every 1/5 of a second
-Take the callback, match up to the existing record in an ObservableCollection
-Update the ObservableCollection's properties
-Bind the grid.
I've tried a linq query, PagedCollectionView, and observablecollection.select(), all are waaaaaaay too slow, and introduce 12+ second delays in processing. Anyone else experience this?
Use PagedCollectionView, but only set it once. Create one view at application startup and then in your WCF callback update the objects instead of creating new ones. Then call Refresh() on your CollectionView.
Calling PagedCollectionView.Refresh from a separate timer works. This prevents the Refresh call from getting called every 1/10 of a second (which is the frequency of callbacks in my scenario).

Resources