xaml - Delegate.Target is null on WinRT -
xaml - Delegate.Target is null on WinRT -
as know, delegate has 2 properties, 1 method infor , other target object. unusual on winrt. if view model implement inotifypropertychanged below:
public class propertychangedviewmodel : inotifypropertychanged { public event propertychangedeventhandler propertychanged { add together { /*some code add together handler of value*/ } remove { /*some code removehandler of value*/ } } } in method "add" , "remove" find value.target null when event used internal code of xaml binding. say, if bind property of view model on xaml file, winrt automaticlly register event propertychanged of view model, , add together method call, placed break point in add together method , find target of value null. i'm implementing cross platfrom mvvm library (for wpf, winrt, silverlight , wp 7+) can't utilize propertychangedeventmanager, have manually maintain weak reference target , invoke method target, unfortunately, targer null, while method not static method, when triger event later, exception. there workaround?
thanks!
xaml delegates windows-runtime
Comments
Post a Comment