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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:04:29+00:00 2026-05-13T06:04:29+00:00

The question is how to implement INotifyPropertyChanged on a static property because the event

  • 0

The question is how to implement INotifyPropertyChanged on a static property because the event you implement is not static, and cannot be called by a static property. Also, you cannot bind to a static property in Silverlight.

I’ve seen this question pop up an a few forums with a variety of solutions, none of which were very satisfying.

Well, I think I’ve found an elegant solution, but it’s so simple I feel like I must be missing something.

The answer is, to write a non-static property that accesses a static variable like so:

    private static double length;
    public double Length
    {
        get
        {
            return length;
        }
        set
        {
            length = value;
            NotifyPropertyChanged("Length");
        }
    }

I’ve tested it and it seems to work just fine. Am I missing something?

  • 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-13T06:04:30+00:00Added an answer on May 13, 2026 at 6:04 am

    Technically, you’re still not binding to a static property – you’re binding to an instance of the class, which is using the static field as a backing store. This will work, to some extent, but…

    There is a fundamental problem with this – If you have more than one item bound to this same backing store (which seems like something you’re attempting, since you’re purposefully making it static), the INotifyPropertyChanged notifications will only happen on the instance where you are currently bound.

    Say, for example, you had two UserControls, sitting side by side, both bound to a ViewModel containing this code. When control A sets this property, control B will never receive notifications (since it’s A’s INotifyPropertyChanged that runs), so it will appear out of sync.

    If you really want to try to do something like this, you’re probably better off having your backing store use a class that implements INotifyPropertyChanged, and “bubble” up the property through your ViewModel class. This way, multiple instances would all be notified correctly, and you could handle any multithreading/synchronization issues that might occur if necessary.

    Alternatively, you may want to consider using a single instance property (with an instance field), inside of a Singleton. This, too, would give you shared notifications of your “static” property.

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

Sidebar

Related Questions

I asked this question a while back but now I'm looking to implement an
I have this question: Does implementing a custom MembershipProvider class needs you to implement
Actually, this question seems to have two parts: How to implement pattern matching? How
Quick question: Would it be a good or a bad idea to implement my
I am looking to implement a data-driven wizard with the question tree stored in
How can I implement a diff function, such as Stack Overflow's question revision history?
That's basically the question, is there a right way to implement operator<< ? Reading
This is a very specific question regarding MySQL as implemented in WordPress . I'm
I apologize for the newbie question, but I am struggling with this problem. I
This is probably a basic question, since I'm new to WPF.. I have a

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.