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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:37:33+00:00 2026-05-27T10:37:33+00:00

This question was asked here for thousands times. But really, none of your examples

  • 0

This question was asked here for thousands times.
But really, none of your examples and answers works for me.
So let me show you my code.

public class PlayList : INotifyPropertyChanged{
    public event PropertyChangedEventHandler PropertyChanged;

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

    private string _dl;
    public string DriveLetter {
        get { return _dl; }
        set {
            if (value != _dl) {
                _dl = value;
                OnPropertyChanged("DriveLetter");
            }
        }
    }
}

public partial class MainWindow : Window {
    public PlayList playlist = new PlayList();

    private void Window_Loaded(object sender, RoutedEventArgs e) {
        Binding bind = new Binding("DriveLetter");
        bind.Source = this.playlist;
        bind.Mode = BindingMode.TwoWay;
        bind.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
        textBox1.SetBinding(TextBlock.TextProperty, bind);

        this.playlist.DriveLetter = "A";
    }
}

Ofcourse WPF ignores this binding (nothing changes when I type in textbox, and nothing changes when I change playlist.DriveLetter property.

Debugger says, that PropertyChanged handler is not null

{Method = {Void OnPropertyChanged(System.Object, System.ComponentModel.PropertyChangedEventArgs)}}

So, any ideas what I am doing wrong. (I do not belive that WPF is wrong)?

Thanks in advance!

  • 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-27T10:37:33+00:00Added an answer on May 27, 2026 at 10:37 am

    Change

    textBox1.SetBinding(TextBlock.TextProperty, bind); 
    

    to

    textBox1.SetBinding(TextBox.TextProperty, bind); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have seen this question asked here a few times, but most question didn't
I know this exact question was asked here , but the answer didn't work
Searching here I found that this question was already asked , but I think
i know this question has been asked here but i am stuck with this
I know this question has been asked here before, but I don't think those
This question was asked here but the issue wasn't resolved. Please see this jsfiddle
This question was asked already here , but rather than answering the specific question,
This question might have asked here number of times . After doing some google
Variations of this question have been asked here and here , but it appears
I realize that there was a similar question asked here , but this is

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.