MVVMSidekick.ViewModels.BindableBase.RaisePropertyChanged C# (CSharp) Method

RaisePropertyChanged() protected method

Raises the property changed.
protected RaisePropertyChanged ( Func lazyEAFactory ) : void
lazyEAFactory Func The lazy ea factory.
return void
        protected internal void RaisePropertyChanged(Func<PropertyChangedEventArgs> lazyEAFactory)
        {


            if (this.PropertyChanged != null)
            {
                var ea = lazyEAFactory();
                this.PropertyChanged(this, ea);
            }


        }

Usage Example

コード例 #1
0
            /// <summary>
            /// Internals the property change.
            /// </summary>
            /// <param name="objectInstance">The object instance.</param>
            /// <param name="newValue">The new value.</param>
            /// <param name="currentValue">The current value.</param>
            /// <param name="message">The message.</param>
            private void InternalPropertyChange(BindableBase objectInstance, TProperty newValue, ref TProperty currentValue, string message)
            {
                var changing = (this.EqualityComparer != null) ?
                               !this.EqualityComparer(newValue, currentValue) :
                               !Object.Equals(newValue, currentValue);


                if (changing)
                {
                    var oldvalue = currentValue;
                    currentValue = newValue;

                    ValueChangedEventArgs <TProperty> arg = null;

                    Func <PropertyChangedEventArgs> lzf =
                        () =>
                    {
                        arg = arg ?? new ValueChangedEventArgs <TProperty>(message, oldvalue, newValue);
                        return(arg);
                    };


                    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(message));
                    objectInstance.RaisePropertyChanged(lzf);
                    ValueChanged?.Invoke(this, lzf() as ValueChangedEventArgs <TProperty>);
                    ValueChangedWithNameOnly?.Invoke(this, new PropertyChangedEventArgs(message));
                    ValueChangedWithNothing?.Invoke(this, EventArgs.Empty);
                }
            }
All Usage Examples Of MVVMSidekick.ViewModels.BindableBase::RaisePropertyChanged