(Until Windows 8 gets more than 50% of windows market share J
After absorbing the shock waves from Microsoft Build 2011 , I was wondering what will happen to the future of WPF/Silverlight but a simple comparison of WPF 4.5 feature set shows that it contains more real features than WPF 4.0 release (WPF 4.0 contains only minor improvement over 3.5). Let’s look into some of my favorite enhancements in WPF 4.5.
1. Improved performance when displaying large sets of grouped data :
The much awaited feature for all WPF developer is here. It consists of 2 parts. First the virtualization in ItemControl (As per build slides now ItemControl can render 200000 items in 2.3 ms). VirtualizingStackPanel now can render the item based on items/ Pixel while scrolling. You can specify whether a VirtualizingPanel, such as the VirtualizingStackPanel, displays partial items by using the ScrollUnit attached property. If ScrollUnit is set to Item, the VirtualizingPanel will only display items that are completely visible. If ScrollUnit is set to Pixel, the VirtualizingPanel can display partially visible items.
Also you can specify the size of the cache before and after the viewport when the VirtualizingPanel is virtualizing by using the CacheLength attached property. The cache is the amount of space above or below the viewport in which items are not virtualized. Using a cache to avoid generating UI elements as they’re scrolled into view can improve performance. The cache is populated at a lower priority so that the application does not become unresponsive during the operation.
2. Accessing collections on non-UI Threads:
No more runtime exception while accessing UI controls from background thread.
3. Asynchronously validating data:
As name indicate no more unresponsive UI for complex data driven validations. The INotifyDataErrorInfo interface enables data entity classes to implement custom validation rules and expose validation results asynchronously. This interface also supports custom error objects, multiple errors per property, cross-property errors, and entity-level errors. For more information, see INotifyDataErrorInfo.
4. Delay Update in data binding:
If you use a data binding to update a data source, you can use the Delay property to specify an amount of time to pass after the property changes on the target before the source updates.
5. Asynchronously validating data:
No more unresponsive UI on complex domain driven validation. The INotifyDataErrorInfo interface enables data entity classes to implement custom validation rules and expose validation results asynchronously. This interface also supports custom error objects, multiple errors per property, cross-property errors, and entity-level errors. For more information, see INotifyDataErrorInfo.
6. Repositioning data as the data's values change (Live shaping) :
A collection of data can be grouped, sorted, or filtered. WPF 4.5 enables the data to be rearranged when the data is modified. For example, suppose that an application uses a DataGrid to list stocks in a stock market and the stocks are sorted by stock value. If live sorting is enabled on the stocks' CollectionView, a stock's position in the DataGrid moves when the value of the stock becomes greater or less than another stock's value. For more information, see the ICollectionViewLiveShaping interface.
7. Integrating WPF with win32 Graphical User Interfaces :
No more air gap issue with win32 control hosted in WPF J.
And much more …………………………………
for more update on WPF 4.5 features.