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

  • Home
  • SEARCH
  • 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 9183579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T18:50:22+00:00 2026-06-17T18:50:22+00:00

It seems that I do something wring with the binding, but after a lot

  • 0

It seems that I do something wring with the binding, but after a lot of tries and research I still didn’t find why (all the examples I found were so similar to my implementation that I can’t see what I did wrong), could you please help me with that?

I have a class called GlobalConfig which implements INotifyPropertyChanged and has a property called Name.

public class GlobalConfig : XmlSoftLinkSerializer, INotifyPropertyChanged
{
    private string _name;
    public string Name 
    { 
        get { return _name; } 
        set 
        {
            if (_name != value && PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("Name"));
            _name = value;
        } 
    }

An ObservableCollection<GlobalConfig> is bound to a ListBox (by setting the DataContext property of the listbox), and I have this DataTemplate for the ListBox:

<DataTemplate>
     <TextBlock Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>

I also have a user control called GlobalConfigUI which is bound to the DataContext of the listbox (using ElementName).

Everything works fine here, but when I change the Name of the config, nothing changes in the listbox…
I checked and I know the PropertyChanged handler in the Name setter is called, also the object GlobalConfig is updated, but the listbox still displays the old name…

here is how the GlobalConfigUI is bound to the DataContext of the listbox:

<my:GlobalConfigUI x:Name="globalConfigUI1" DataContext="{Binding ElementName=settingsListBox, Path=SelectedValue, Mode=TwoWay}" />

and here is how the TextBox inside the GlobalConfigUI control is bound to the Name property:

<TextBox Name="configNameTextBox" Text="{Binding Path=Name, Mode=TwoWay, BindsDirectlyToSource=True}" MinWidth="380" />

I’m not completely new to WPF but I’ve used it only like 2 or 3 times, so I think there must be some kind of rooky mistake here, any hints?

  • 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-17T18:50:24+00:00Added an answer on June 17, 2026 at 6:50 pm

    As a first remark, change your TextBox binding by adding UpdateSourceTrigger=PropertyChanged. Also about BindsDirectlyToSource, I rarely use it. Remove it and check again

    Also, change your implementation to

    private string _name;
    public string Name 
    { 
        get { return _name; } 
        set 
        {
            _name = value;
            if (_name != value && PropertyChanged != null)
                PropertyChanged(this, new PropertyChangedEventArgs("Name"));
    
        } 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am having a heck of time with something that seems rather straightforward but
I have created branch with git checkout -b mybranch. It seems that something went
Something that seems to be absent from the otherwise great new features for Windows
I am looking to write something that seems like it should be easy enough,
I was doing some performance metrics and I ran into something that seems quite
This seems like something that could be quite useful and yet and I can't
I have a problem with something that otherwise seems to be an easy task.
I'm learning asp.net mvc and found something interesting: It seems that I can't explicitly
I have a problem that seems so senseless that I'm sure I'm missing something
cgi.escape seems like one possible choice. Does it work well? Is there something that

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.