-api-id | -api-type |
---|---|
T:Windows.UI.Xaml.Data.PropertyChangedEventHandler |
winrt delegate |
Represents the method that will handle the PropertyChanged event. When programming with Microsoft .NET this delegate is hidden, use the System.ComponentModel.PropertyChangedEventHandler delegate.
The source of the event.
Event data.
When programming with Microsoft .NET, this delegate is hidden. Microsoft .NET Developers should use the System.ComponentModel.PropertyChangedEventHandler delegate.
This example demonstrates how to implement the INotifyPropertyChanged interface and use PropertyChangedEventHandler. For the complete code listing, see the XAML data binding sample.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace DataBinding
{
public class Employee : INotifyPropertyChanged
{
private string _name;
private string _organization;
public string Name
{
get { return _name; }
set
{
_name = value;
RaisePropertyChanged("Name");
}
}
public string Organization
{
get { return _organization; }
set
{
_organization = value;
RaisePropertyChanged("Organization");
}
}
public event PropertyChangedEventHandler PropertyChanged;
protected void RaisePropertyChanged(string name)
{
if (PropertyChanged != null)
{
PropertyChanged(this, new PropertyChangedEventArgs(name));
}
}
}
}