Bind to collection commands in data template

I have a list box with a collection as its data context and I have defined a data template to have specific view of collection items.

I want to execute commands at the collection level that may apply to some items or not and want to use them in data template. There are a lot of code to insert, but hope that this picture give you the general idea.

How can I define such commands in data templates that binds to command at collection level and how to know which item has sent the command?


I finally found the solution in the following article :

Command Binding inside DataTemplate in Parent-Child Scenario in an MVVM Application

By Amit Kumar Dutta

Need Your Help

AngularJs Table Sorting when Data is nested

javascript angularjs sorting

How can I approach table sorting in angularjs, when my data is nested and not all columns are first level citizens of the objects.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.