Pages

Monday, 30 July 2012

Replicating TargetNullValue in WinRT Metro Style Apps

There are times in this world when using binding statements, that you want to specify a default value for a property if the result provided is null. In a post found here by Jesse Liberty, he details how developers can utilize the TargetNullValue option within the xaml binding statement to provide this option.
Recently I’ve been porting my SaintsFC WP7 app over to Windows 8 metro app & I’ve found that this option is no longer available. It’s been confirmed that this will likely not be in the RTM version of Windows 8 either so here’s a workaround using a converter as a substitute. It’s a little more convoluted than a simple property within the binding but it will also be able to provide you with a more extensive feature set as a result.

Read full article here
Download source code from here

No comments:

Post a Comment

Web Informer Button