PropertyChangedEventHandler delegate

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

Syntax


public delegate void PropertyChangedEventHandler(
  Object^ sender, 
  PropertyChangedEventArgs e
)

Attributes

[Version(0x06020000)]
[WebHostHidden()]

Parameters

sender

Type: Object

The source of the event.

e

Type: PropertyChangedEventArgs

Event data.

Remarks

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

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


Requirements (device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows::UI::Xaml::Data

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (operating system)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows::UI::Xaml::Data

Metadata

Windows.winmd

See also

Binding
XAML data binding sample
Data binding overview

 

 

Show:
© 2015 Microsoft