BusyService and GetView

Sep 26, 2010 at 8:42 PM

I'm testing the busyservice posted by Rob, but i wonder why the GetView in this service gives me a null.

private FrameworkElement GetView(object viewModel)
      var viewAware = viewModel as IViewAware;
      if (viewAware == null)
        return null;
      return viewAware.GetView() as FrameworkElement;

I use it in a viewmodel based on propertychangedbase. I'm fairly new to this so i wondered that i should implement IViewAware, but i don't know what to put in there.

So how the get the view that was binded to the viewmodel?

Sep 27, 2010 at 6:59 AM

Inherit from the Screen instead. It has an implementation of IViewAware.

Sep 27, 2010 at 7:55 PM

OK, this works, thanks!