silverlight adding single prism command delegate to a list of items in xaml

Posted by bobwah on Stack Overflow See other posts from Stack Overflow or by bobwah
Published on 2010-04-23T11:01:01Z Indexed on 2010/04/23 11:03 UTC
Read the original article Hit count: 221

Filed under:
|
|

I'm building a menu using Prism (using a trtelerik tree view with hierarchy data templates but hopefully the details don't matter) and I'm trying to set up a Click.Command on each menu items bindings that will all call the same delegate command which is defined in the view model. The menu is built up out of items which I don't really want to put any references to the command in.

How do I bind the command to each of these items in xaml? I've looked around and it looks like in WPF I could use a relative source binding and find ancestors but there doesn't seem to be a way of doing this in silverlight. Can I setup the delegate as a static resource somehow? I don't think I can create a static resource to the view model as this uses Unity to resolve paramters to it's constructor.

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about prism