Property​Changed​Event​Handler Property​Changed​Event​Handler Property​Changed​Event​Handler Delegate

Definition

Represents the method that will handle the PropertyChanged event. When programming with Microsoft .NET this delegate is hidden, use the System.ComponentModel.PropertyChangedEventHandler delegate.

public : delegate void PropertyChangedEventHandler(PlatForm::Object sender, PropertyChangedEventArgs e)public delegate void PropertyChangedEventHandler(Object sender, PropertyChangedEventArgs e)Public Delegate PropertyChangedEventHandler(sender As Object, e As PropertyChangedEventArgs)
Parameters
sender
PlatForm::Object Object Object

The source of the event.

e
PropertyChangedEventArgs PropertyChangedEventArgs PropertyChangedEventArgs

Event data.

Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

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));
            }
        }
    }
}

Remarks

When programming with Microsoft .NET, this delegate is hidden. Microsoft .NET Developers should use the System.ComponentModel.PropertyChangedEventHandler delegate.

See Also