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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:30:05+00:00 2026-06-07T00:30:05+00:00

I have successfully bound a control to a property on my page. The property

  • 0

I have successfully bound a control to a property on my page. The property I am binding to returns a class. The binding works but if I set the property to be a new instance of the class the UI is not updated.

Could anyone point be in the right direction to solve this issue, I have tried implementing INotifyPropertyChanged but this doesn’t work.

The Code is as follows..

XAML – Very Basic just trying to bind a label to a property at the minute.

<Grid>
        <Label Content="{Binding StudentName}"></Label>
        <Button Width="100" Height="75" Click="Button_Click" ></Button>
</Grid>

C#

this.DataContext = parentWindow.SelectedStudent;

The parent Window C# note parent window implements INotifyPropertyChanged

public event PropertyChangedEventHandler PropertyChanged;

public UCStudent SelectedStudent
{
            get
            {
                if (_selectedStudent == null)
                {
                    _selectedStudent = new UCStudent();
                }

                return _selectedStudent;
            }

            set
            {
                if (_selectedStudent != value)
                {
                    _selectedStudent = value;
                    OnPropertyChanged("SelectedStudent");
                }
            }
 }

 protected void OnPropertyChanged(string name)
    {
        PropertyChangedEventHandler handler = PropertyChanged;
        if (handler != null)
        {
            handler(this, new PropertyChangedEventArgs(name));
        }
    }

The issue is when I set the SelectedStudent property to be a new selected student the binding does not update.

  • 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-07T00:30:07+00:00Added an answer on June 7, 2026 at 12:30 am

    While my approach uses generics and an expression, so I can strongly type my property changes, the concept is the same. Where I use an expression, you use a string. You’ll want to return if PropertyChanged is null. Otherwise, fire the event without declaring a new event handler first.

    public event PropertyChangedEventHandler PropertyChanged;
    
        protected void NotifyPropertyChanged<T>(Expression<Func<T>> expression)
        {
            if (this.PropertyChanged == null) { return; }
    
            string propertyName = GetPropertyName(expression);
    
            PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
        }
    

    This approach allows the view model to strongly type the notification.

    this.NotifyPropertyChanged(() => this.SelectedApplication);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have successfully created and bound computed properties, but how can I get at
I have successfully bound my DataGridView to a list. But, the grid doesn't refresh
i have successfully created distribution profiles and installed on my xcode organiser, but this
I have a TreeView that is bound to a collection class that I have
I have an ObjectDataSource on an ASP.NET WebForms page, that also has a data-bound
Using MVVM style I have successfully bound an ObservableCollection<string> to a ListBox , showing
I have successfully implemented my GridView now, but, as always, the whole ASP.NET life
I have successfully bound a circle to my marker using google map api v3.
I'm building a data entry interface and have successfully bound the columns that have
I'm creating a Silverlight App. I have successfully created the data, bound it to

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.