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 8790761
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:44:28+00:00 2026-06-13T22:44:28+00:00

I am using a silverlight application. Trying to bind a button’s click command to

  • 0

I am using a silverlight application. Trying to bind a button’s click command to a relay command in ViewModel and passing some parameters to it. Code for my View is :

<Button x:Name="button" Content="Button" VerticalAlignment="Top" Margin="173,0,152,0">
        <i:Interaction.Triggers>
            <i:EventTrigger EventName="Click">
                <i:InvokeCommandAction CommandParameter="{Binding ActualWidth, ElementName=button, Mode=TwoWay}" Command="{Binding CRelayDecimal, Mode=OneWay}"/>
            </i:EventTrigger>
        </i:Interaction.Triggers>
</Button>

A button is passing it’s ActualWidth as parameter for command’s parameter. My ViewModel code is:

public Page1()
{
    InitializeComponent();
    CRelayDecimal = new RelayCommand<Object>(this.GetDecimal);
}

public RelayCommand<Object> CRelayDecimal { get; private set; }

private void GetDecimal(Object Obj)
{
    var value = (double)Obj;
}

Now, the problem I see here is that most of the time passed parameter value I receive is 0.0. Intermittently, I’ve seen value to be precise value (like.. 75.0) that it should be.

Is there any other way of doing it ?

Thanks you all for your help in advance.

Thanks and Regards

Nishant Rana

  • 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-06-13T22:44:29+00:00Added an answer on June 13, 2026 at 10:44 pm

    Okay Got the answer why this was not working.. because it’s a known issue in silverlight.

    Read this link for details from MSFT.

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

Sidebar

Related Questions

I am trying to develop a Silverlight 4 application using C# 4.0. I have
I'm trying to build a line of business application using Silverlight. I felt like
I'm trying to add an image to a button in my silverlight 3 application
I'm trying to make a control for a silverlight application and I'm having some
I'm trying to create an silverlight application using the MVVM design pattern. It's a
I am trying to debug my silverlight application running under IE8.0. Its using .NET
I am using C# to create a Silverlight 4 application. I am trying to
I’m trying to create a new project using the Silverlight 4 business application template
I am trying to build a small silverlight application to support some midi files
I'm trying to see the framerate of a silverlight application. I'm using IE 8

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.