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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T07:35:44+00:00 2026-05-18T07:35:44+00:00

I have a problem with updating the value of property from code which is

  • 0

I have a problem with updating the value of property from code which is bind to textbox (the textbox is not displaying new value).

It was normally working without any problems but in this case source class is in separate assembly (Don’t know if it is making any difference).

  1. If I type in textbox the value will be updated in the code
  2. When I change the property value directly in code textbox is not displaying new value.
  3. After changing the value in textbox one more time the previously set value (in code) is overwritten (so binding is still working).

Additionally I’ve checked if PropertyChanged event is fired and it is after every change.

Any guesses why it’s not working? Below corresponding binding and source class.

TextBox Text=”{Binding Path=Description, Mode=TwoWay}”

[DataContract]
public class Source : INotifyPropertyChanged
{
    private String _Description;

    [DataMember]
    public String Description
    {
        get { return _Description; }
        set
        {
            if (_Description == value)
                return;

            _Description = value;
            OnPropertyChanged("Description");
        }
    }

    public event PropertyChangedEventHandler PropertyChanged;

    protected virtual void OnPropertyChanged(string propertyName)
    {
        PropertyChangedEventHandler handler = this.PropertyChanged;
        if (handler != null)
        {
            var e = new PropertyChangedEventArgs(propertyName);
            handler(this, e);
        }
    }
}

I’ve Fix the problem it was not connected to different assembly obviously. I have a bug in setting value to property.

  • 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-18T07:35:45+00:00Added an answer on May 18, 2026 at 7:35 am

    It works fine by me. The only difference is DataContract tag removed and DataContext assigned. and My sample is following:

    <Window x:Class="_4206499.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="360" Width="578">
    <Grid>
        <TextBox Text="{Binding Path=Description, Mode=TwoWay}" VerticalAlignment="Center" Margin="12,12,286,278" />
        <Button Width="100" Margin="57,59,346,219" Click="Button_Click"></Button>
    </Grid>
    

    and code behind is

    using System;
    using System.Windows;
    using ClassLibrary1;

    namespace _4206499
    {
    public partial class MainWindow : Window
    {
    public MainWindow()
    {
    InitializeComponent();
    Source = new Source();
    DataContext = Source;
    }

        public Source Source { get; set;}
    
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Source.Description = DateTime.Now.ToString();
        } 
    }
    

    }

    and one from separate class library:

    
    using System;
    using System.ComponentModel;

    namespace ClassLibrary1
    {
    public class Source : INotifyPropertyChanged
    {
    private String _Description;

        public String Description
        {
            get { return _Description; }
            set
            {
                if (_Description == value)
                    return;
    
                _Description = value;
                OnPropertyChanged("Description");
            }
        }
    
        public event PropertyChangedEventHandler PropertyChanged;
    
        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                var e = new PropertyChangedEventArgs(propertyName);
                handler(this, e);
            }
        }
    }
    

    }

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

Sidebar

Related Questions

Problem solved, see below Question I'm working in Flex Builder 3 and I have
I have a strange problem in my rich client application. Here is some background:
I'm currently working on a quite big (and old, sigh) code base, recently upgraded
I have a WPF form with a combobox and a textbox (both are databound
I am creating a FlippingBook Silverlight application and I have run into a snag
I am using asp.net mvc for an application. I've taken some guidance from Rob
I have a ComboBox that doesn't seem to update the SelectedItem/SelectedValue. The ComboBox ItemsSource
I am using JPA with openjpa implementation beneath, on a Geronimo application server. I
All right, I've seen some posts asking almost the same thing but the points
One example of the general case: public class Validator { // ... public ReadOnlyCollection<InvalidContainer>

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.