Contents tagged with INotifyPropertyChange

  • XAML simplification of usage INotifyPropertyChanged

    Hello,

    I want to share some code, wich can simplify usage of INotifyPropertyChanged in XAML.

    Take a loot at following fragments:

    Snippet

    namespace NotifyPropertyChanged

    {

        public class BindableBase : INotifyPropertyChanged 

        {

            public event PropertyChangedEventHandler PropertyChanged;

            public void RaisePropertyChanged(string propertyName)

            {

                if(PropertyChanged != null)

                {

                    PropertyChanged.Invoke(this, new PropertyChangedEventArgs(propertyName));

                }

            }

        }

    }

    Class BindableBase now can become as base class for those objects, which need to notify UI about changes in source code. Consider … more