Hi,@43061275. I have not been able to reproduce your problem. Could you show minimal code that reproduces the problem?
xaml:
<Window.DataContext>
<local:Person/>
</Window.DataContext>
<StackPanel>
<TextBox x:Name="tb" Text="{Binding PersonName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="50" Background="AliceBlue"/>
<TextBlock x:Name="tb1" Text="{Binding PersonName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Height="50" Background="AliceBlue"/>
</StackPanel>
codebehind:
public class Person: INotifyPropertyChanged
{
private string name = "hello";
public string PersonName
{
get { return name; }
set
{
name = value;
ChangeProperty();
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void ChangeProperty([CallerMemberName] string name = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(name));
}
}
The result:
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.