Blend 4 designer fails with: "Method not found: 'Void Microsoft.Practices.Prism....'" (Prism 4)

Topics: Prism v4 - Silverlight 4
Dec 22, 2010 at 11:43 AM

Hi everyone!

I have 2 views that fail in Expression Blend 4 designer, even though they work in Visual Studio designer and while being executed. I am using Prism 4.

In one of the views, in the constructor I register a command, like this:

MatchChanged = new DelegateCommand<object>(this.OnMatchChanged);
GlobalCommands.MatchChangedCommand.RegisterCommand(MatchChanged);



When i load this view in Blend 4, it says: "Method not found: 'Void Microsoft.Practices.Prism.Commands.CompositeCommand.RegisterCommand(System.Windows.Input.ICommand)'", and the view does not load.

In the other, I use "RaisePropertyChanged" in the setters like this:

public int SelectedPageIndex
{
   get { return selectedPageIndex; }
   set { selectedPageIndex = value;
          RaisePropertyChanged(() => SelectedPageIndex); }

}

When i load this view in Blend 4, it says: "Method not found: 'Void Microsoft.Practices.Prism.ViewModel.NotificationObject.RaisePropertyChanged(System.Linq.Expression`1<System.Func`1<!!0>>)'", and the view does not load.

Note that all views work, both in Visual Studio as when they are used as part of a executable, so there is no programming issue.

Does anyone have a clue what's wrong?

 

Dec 22, 2010 at 6:01 PM

Hi,

You might find some information that might help you troubleshoot this on the following chapter of the Prism MSDN documentation, under the "Guidelines for Creating Designer Friendly Views":

Chapter 7: Composing the User Interface

Inside the aforementioned section you can find a table that shows different things that can or cannot be done in Blend, as well as some guidance on how to avoid these kind of errors.

Also you might find this thread interesting.

I hope you find this information useful.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

 

Dec 22, 2010 at 7:01 PM

Thanks for your answer!

I already read the Guidelines but could'nt find a useful hint regarding these problems.

Obviously, this is some kind of bug. There are means to work around these problems, f. e. one can use the RaisePropertyChanged()-overload that takes a string argument instead of the one with the Function. In the other case, you can move the code out of the constructor in some subroutine which makes Blend want to work again. Still, these things are unsettling because you start working around things and you never know if you have a reasonable, acceptable workaround the next time such a problem arises. This makes me feel uncomfortable about the Visual Studio-Blend workflow. Seems to be much more fragile than it should be.

Greetings!