INotifyPropertyChanged interface is used to notify the view or ViewModel that it does not matter which property is binding; it is updated.
Let's take an example for understanding this interface. Take one WPF Window in which there are a total of three fields: First Name, Last Name and Full Name. Here, first name and last name text boxes are editable. So, based on the change in first name and last name, we have to automatically update the full name.
Make window design-like.

XAML Code for the WPF Window is given below.
<Window x:Class="MVVM_INotifyPropertyChanged.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow">
<Grid Width="400" Height="Auto" HorizontalAlignment="Center" VerticalAlignment="Stretch" Margin="20">
<Grid.RowDefinitions>
<RowDefinition Height="40" />
<RowDefinition Height="40" />
<RowDefinition Height="40" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Grid.Row="0" Grid.Column="0" Content="First Name : "></Label>
<Label Grid.Row="1" Grid.Column="0" Content="Last Name : "></Label>
<Label Grid.Row="2" Grid.Column="0" Content="Full Name : "></Label>
<TextBox Grid.Row="0" Grid.Column="1"></TextBox>
<TextBox Grid.Row="1" Grid.Column="1"></TextBox>
<TextBox Grid.Row="2" Grid.Column="1"></TextBox>
</Grid>
</Window>
Now, we create one model, which contains one class called person and it has 3 properties “FirstName”,” LastName”,” and FullName”.
public class Person
{
private string _fisrtname;
public string FirstName
{
get
{
return _fisrtname;
}
set
{
_fisrtname = value;
}
}
private string _lastname;
public string LastName
{
get
{
return _lastname;
}
set
{
_lastname = value;
}
}
private string _fullname;
public string FullName
{
get
{
return _fisrtname + " " + _lastname;
}
set
{
_fullname = value;
}
}
public Person()
{
_fisrtname = "Nirav";
_lastname = "Daraniya";
}
}
Now our actual part is started. We implement the interface on the “Person” class so it automatically creates one event.
public event PropertyChangedEventHandler PropertyChanged;
Now, we have to call this event, when any property of class is changed. Thus, we create one method in which this event is called. in this method, we first check if the event is null or not, if not, we proceed.
private void OnPropertyRaised(string propertyname)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(propertyname));
}
}
Now, we run this event by passing the property name.


Akshay KapoorPosted May 19, 2023, 6:59 AM
<TextBox Grid.Row="0" Grid.Column="1" Text="{Binding Path=FirstName} , UpdateSourceTrigger=PropertyChanged"></TextBox> <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=LastName} , UpdateSourceTrigger=PropertyChanged"></TextBox> <TextBox Grid.Row="2" Grid.Column="1" Text="{Binding Path=FullName} , UpdateSourceTrigger=PropertyChanged"></TextBox>
Akshay KapoorPosted May 19, 2023, 6:59 AM
Getting error when binding in textbox using command :Severity Code Description Project File Line Suppression StateError XDG0055 The character "," is unexpected at this position. INotifyPropertyChangedWpfApp C:\Users\akshkapo\source\repos\INotifyPropertyChangedWpfApp\MainWindow.xaml 30
paz krolowejPosted Oct 27, 2021, 8:10 PM
Thanks for a good and simple explanation.
Azi SPosted Nov 29, 2019, 2:35 AM
Good one........................
Diogo SantoPosted Nov 30, 2017, 4:35 AM
I set up the last textbox with: Text="{Binding Path=FullName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}", yet it still doesn't update the Full Name field with the changes on the First and Last name fields. Is this an incorrect way of tackling the problem, and can anyone point me in the right direction please?
Runni KumariPosted Nov 23, 2017, 12:48 AM
Very bad example ... and too much mistakes
Runni KumariPosted Nov 23, 2017, 12:48 AM
Not working at all
Karthikeyan KPosted Oct 4, 2016, 12:29 PM
Good one...Thanks for sharing