Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6167631
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:32:49+00:00 2026-05-23T22:32:49+00:00

I am working on a Silverlight application which makes an extensive use of Prism,

  • 0

I am working on a Silverlight application which makes an extensive use of Prism, the MVVM pattern and MEF. For several reasons, I have chosen to follow a View-first approach.

In one of the Views there is a DataGrid, and one of the columns of this grid is a DataGridTemplateColumn, which has just a Button.

I’d like to define both a Command and a CommandParameter on the Button. The Command should be a DelegateCommand of the ViewModel. CommandParameter should be the SelectedItems list coming straight out of the dataGrid.

I’ve tried several approaches to do this, but either Command or CommandParameter are null.

It follows the code that I originally wrote:

<sdk:DataGridTemplateColumn>
    <sdk:DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <Button Width="15" Height="15" Content=">" 
                    Command="{Binding UpdateSearchParametersCommand}" 
                    CommandParameter="{Binding SelectedItems, ElementName=dataGrid}">
        </DataTemplate>
    </sdk:DataGridTemplateColumn.CellTemplate>
</sdk:DataGridTemplateColumn>

Could someone advice me on what the best way to go about it is?

Thanks in advance,
Gianluca.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T22:32:50+00:00Added an answer on May 23, 2026 at 10:32 pm

    Many of you tried to help me out on this. Thank you for that.
    Unfortunately the provided answers were mostly relative to WPF.

    Here is how I’ve solved the problem:

    <helpers:BindingHelper.Binding>
    <helpers:BindingList>
         <helpers:RelativeSourceBinding TargetProperty="Command" Path="DataContext.ToggleDataArchiveInheritanceCommand" RelativeMode="FindAncestor" AncestorType="ChildWindow" />
    </helpers:BindingList>
    </helpers:BindingHelper.Binding>
    

    Ok, this comes from another point of the same application, but the principle is the same.
    If a binding is defined inside a , the only way you have in Silverlight to reach out other elements that normally would be out-of-scope (as they are not part of the DataTemplate) is to walk through the xaml object tree. That’s what the BindingHelper does.

    Posting here as I hope the information will be useful to someone else.

    Cheers,

    Gianluca

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight application that consists of a MainWindow and several classes which
I have a working WinForms application, written in c#, which is divided in several
I have been working with a Linq query in a Silverlight application which returns
I am working in Silverlight 4.0 and have created a web application which is
I am currently working on a silverlight business application, so I have come across
I'm working on a Silverlight application and I have a hard time setting the
I have a Silverlight application that I am working on. I have a few
I am working on Windows Phone 7.1 application. I have a UserControl which has
I've been working on a silverlight application which generates various graphs. It requires a
I'm working on a Silverlight page which has several modules for querying and plotting

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.