Create Globally Available Command

Topics: Prism v2 - WPF 3.5
Nov 5, 2009 at 9:57 AM

Hi Guys,

I am just starting in Prism.

I have read the article How To Create A Globally Available Command, but find it unclear.

The documentation says "if you want to expose the command to views from multiple modules, place the static class in the infrastructure project".

Could someone please show me the code to do this ?

I assume the Static Class is injected into the container somehow.

I am using VB.NET. The equivalent of a static class in VB.NET is a 'Module'. These cannot have Interfaces. I guess I would therefore have to implement the class containing the CompositeCommands as a normal, non-static class and register an instance of it in the container as a Singleton.

Any assistance appreciated.

I am greatly enjoying using the Prism fraework. Thanks guys!

Nov 6, 2009 at 11:07 AM


A good example of using CompositeCommands can be found in the source code of this link:

How To: Integrate a Prism v2 application with the Silverlight 3 Navigation Framework


Download the source code and check the CommandProxy class.


Hope this helps,