1
Vote

Invalid property name validation in WinRT/ObservableObject

description

In WinRT using RaisePropertyChanged(string) fails in VerifyPropertyName in Debug mode, if the property is in parent class for the target object, see this reproduction scenario:

http://pastebin.com/ZVKA8Fyt

Workaround - use Release mode, use RaisePropertyChanged(() => propertyName) for property change notification or download the source code and remove the VerifyPropertyName usage in RaisePropertyChanged(string)

comments

Necroman wrote Apr 4, 2013 at 9:04 AM

it coulld be probably fixed by using
myType.GetRuntimeProperty(propertyName)
instead of
myType.GetTypeInfo().GetDeclaredProperty(propertyName)