Sep 7, 2010 at 5:19 PM
Edited Sep 7, 2010 at 6:31 PM
Since I've upgrade from change set 48912 to 50505 design-time support seems to be broken, even on your demo project. After some debugging I found that during design-time ViewAwareStatus::InjectContext() that view is always null.
So the following always is false:
var x = view as FrameworkElement;
if (x != null)
x.Loaded += OnViewLoaded;
x.Unloaded += OnViewUnloaded;
Window w = x as Window;
if (w != null)
w.Activated += OnViewActivated;
w.Deactivated += OnViewDeactivated;
//get the Views Dispatcher
this.ViewsDispatcher = x.Dispatcher;
weakViewInstance = new WeakReference(x);
When debugging design time using change set 48912 then x != null, with change set 50505 then x == null
You can easily reproduce this using the CinchV2 WPF demo, open it in Blend, attached VS debugger to Blend, put breakpoint in ViewAwareStatus and open ImageLoaderView in Blend.
Any idea where I should look to fix this?