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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:18:09+00:00 2026-05-25T03:18:09+00:00

In WPF, I have a property with only a get{}. The value is coming

  • 0

In WPF, I have a property with only a get{}. The value is coming from the return of method. NotifyPropertyChanged is often used within a property set{}. It can then notify the UI and the updated value is displayed. But with a get{} only, there isn’t a way of detecting if a new or different value is available since you have to execute the method to check.

Is there some way to update the UI without having to keep a local value that contains the last value from the method, in which case a compare would need to be done?

  • 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-25T03:18:09+00:00Added an answer on May 25, 2026 at 3:18 am

    But with a get{} only, there isn’t a way of detecting if a new or different value is available since you have to execute the method to check.

    The problem boils down to this: What is changing the property? The method that changes the property should call your NotifyPropertyChanged with the name of the property, which will, in turn, cause WPF to refetch the value and update the user interface.

    WPF doesn’t care where the PropertyChanged event gets raised – it just listens for it, and refreshes the binding as needed.


    Edit in response to comment:

    It sounds like this may be the result of performing some operation upon your Model class. In this case, it’s common that you know that one or more properties may change, but not necessarily which ones. If your Model implements INotifyPropertyChanged, you can subscribe to that and “bubble up” the notifications to the UI via your NotifyPropertyChanged method. If it does not, however, there is another option.

    If you know that one or more properties may change, you can raise a PropertyChanged event with string.Empty as the PropertyName in the EventArgs. This will cause all bound properties to get refreshed by WPF. This is likely just a matter of putting something like this in your code:

    this.Model.DoSomething(); // This will change 1+ properties
    this.NotifyPropertyChanged(string.Empty); // Refresh our entire UI
    

    I wouldn’t recommend doing this everywhere, however, as it does add overhead – but it’s often the cleanest solution if you don’t know which properties will change when you perform an operation.

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

Sidebar

Related Questions

In WPF, is there any way to have the Text property of a TextBlock
do routed events from wpf have something in common with the chain of responsibility
I have WPF Span that is used as a source to a TextBlock. I
I'm moving my old app from windows forms to WPF and have encountered an
I have a custom control Workspace that inherits from Control and within it is
I have a UserControl with the following Property: public List<Rect> HotSpots { get {
I came from web development and WinForms to WPF and maybe I didn't get
I cannot get a two-way bind in WPF to work. I have a string
I need to implement a read only property on my type. Moreover the value
in winForms, I have .Handle property, how do I get the equivalent to in

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.