This project is read-only.

Exception handing in PropertyObserver<>::GetPropertySource()

Jul 16, 2009 at 6:46 AM

 

Hi, Josh!
What are you trying to catch in this method?
TPropertySource GetPropertySource()
{
  try
  {
      return (TPropertySource)_propertySourceRef.Target;
  }
  catch 
  {
      return default(TPropertySource);
  }
}

(http://mvvmfoundation.codeplex.com/sourcecontrol/changeset/view/28982?projectName=mvvmfoundation#531065)

 

Jul 16, 2009 at 3:41 PM

I have seen exceptions thrown when accessing the Target property (very rarely).  I am extra careful when working with WeakReference objects.