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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:51:06+00:00 2026-05-29T09:51:06+00:00

Before I get to my question/problem, here is the basic structure of my application:

  • 0

Before I get to my question/problem, here is the basic structure of my application:

In my MainWindow.xaml (the main view in this case) I have a Label (I realize I should change this to a TextBlock, but that is a separate issue):

<Label Name="StatusLabel" Content="{Binding Path=Status}"/>

It’s corresponding ViewModel (MainWindowViewModel) contains another ViewModel (SiteListViewModel) and a Status property:

public class MainWindowViewModel : ViewModelBase
{
    public SiteListViewModel SiteList { get; set; }
    public String Status
    {
        get { return SiteList.Status; }
    }
}

As you can see, MainWindowViewModel’s Status property returns the SiteListViewModel instances’ Status property, which is defined as such:

public class SiteListViewModel : ViewModelBase
{
    private string status;
    public String Status 
    {
        get { return this.status; }
        set
        {
            this.status = value;
            base.OnPropertyChanged("Status");
        }
    }
}

SiteListViewModel’s Status property is updated in various places during asynchronous processes to keep the user informed as to what is going on. This is done with simple assignment calls such as:

Status = String.Format(Properties.Resources.SiteListViewModel_Status_LoadingJobs, count + 1, totalSites);

Another important note, Both MainWindowViewModel and SiteListViewModel inherit from ViewModelBase which implements INotifyPropertyChanged.

Now for the actual question/problem:

The label does not update.

However, if I change the binding in the view to this:

<Label Name="StatusLabel" Content="{Binding Path=SiteList.Status}"/>

It works fine. Which seems to indicate that I am missing something at the MainWindowViewModel level. I could leave it as it is, but that reaches into the structure of the child view model, which is not something I want to do.

Can someone point to what I am doing wrong?

  • 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-29T09:51:07+00:00Added an answer on May 29, 2026 at 9:51 am

    Of course it does not update, the binding system listens to change events for the property you bind to on the type owning that property, you do not fire any notifications at all.

    You could forward the notifications of the nested VM:

    public MainWindowViewModel
    {
        SiteList.PropertyChanged += (s,e)
            => if (e.PropertyName == "Status") OnPropertyChanged("Status");
    }
    

    Where OnPropertyChanged is a method to raise PropertyChanged; your VM base-class should have something like that.

    I would recommend dropping the property though, it’s redundant as you can bind directly though SiteList (also that property should fire change notifications in its setter). Also you would need to detach the handler from the old instance and re-attach it to the new instance whenever the SiteList changes (could be done in the setter as well).

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

Sidebar

Related Questions

I have asked this before but I didn't get the question right so the
Before I get into the details of this problem, I'd like to make the
I have tried to ask a variant of this question before. I got some
Hi this question or problem i have its very hard i have search and
Before I posted this question, I already looked this , but I couldn't get
I've asked this question before but I didn't seem to get the right answer.
I have asked this question in a different post here on SO: How can
Although this question have been asked and answered before, including on this website, I
I realize that this is probably a very basic question, but I have spent
I know that this question is being asked before but I did not get

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.