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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T16:05:55+00:00 2026-06-01T16:05:55+00:00

I have a button whose content is binded with ViewModel’s property called Test. <Button

  • 0

I have a button whose content is binded with ViewModel’s property called Test.

<Button Content="{Binding Test, Mode=TwoWay}"  
            Name="button1"Click="button1_Click" />

On click of the button I am changing its content

private void button1_Click(object sender, System.Windows.RoutedEventArgs e)
{
    button1.Content = "Yellow";
}

But in the property setter I would like to override the content being set and set my own content.
Following is the code for same:

string _test;
public string Test
{
    get
    {
        return _test;
    }
    set
    {
        _test = "Something" + System.DateTime.Now.ToString();
        RaisePropertyChanged(() => Test);
    }
}

Now the problem is button’s content is getting set as “Yellow” instead of that it should be something like “Something…”

If I bind this property with textbox at the same time, there the value is being displayed in the correct manner.

Note: this is just an example and focus of my question is raisepropertychanged.

Please help.

  • 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-01T16:05:56+00:00Added an answer on June 1, 2026 at 4:05 pm

    Thanks everyone for your answers. I have figured out that it worked when you run it in the Non-debug mode. But in case of Call Back it will not work even in non-debug mode.

    I have finally got the solution which mentioned in the article http://info.titodotnet.com/2011/08/silverlight-dependency-property-clr.html

    Cheers!

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

Sidebar

Related Questions

I have a Button and the button content is binded to a custom class
I have an NSArrayController whose content is the servers property of my AppDelegate. I
I have a global variable called 'name', when a user clicks on a button
I need to have a button whose text is underlined and the only way
I've created a small user control consisting of a button whose content is an
I have a Button within my app whose enabledness I have bound to whether
I have a button whose ClickMode is initially set to Press. The code for
I have a positioned div whose content can be too long so scrollbars appear
I have a UIWebView and one page has an AJAX component whose content changes
I have a web content form whose master page is a nested master page.

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.