Exemple #1
0
        ///<summary>Fires INotifyPropertyChanged.OnPropertyChanged for this given property Expression.
        ///Call this from a setter property to notify bindables that this property has changed.</summary>
        public new void RaisePropertyChanged(string propertyName)
        {
            PropertyInfo prop = GetType().GetProperty(propertyName);

#pragma warning disable 0618
            OnPropertyChanged(propertyName);
#pragma warning restore 0618
            BindablePropertyAttribute attr = prop.GetCustomAttribute <BindablePropertyAttribute>();
            if (attr != null && !attr.ListDependentPropertyNames.IsNullOrEmpty())
            {
                //Raise property changed on any dependent properties.
                attr.ListDependentPropertyNames.ForEach(x => RaisePropertyChanged(x));
            }
        }
Exemple #2
0
        ///<summary>Fires INotifyPropertyChanged.OnPropertyChanged for this given property Expression.
        ///Call this from a setter property to notify bindables that this property has changed.</summary>
        public void RaisePropertyChanged <T>(Expression <Func <T> > property)
        {
            MemberInfo member = MemberUtils.GetMemberInfo(property);

#pragma warning disable 0618
            OnPropertyChanged(member.Name);
#pragma warning restore 0618
            BindablePropertyAttribute attr = member.GetCustomAttribute <BindablePropertyAttribute>();
            if (attr != null && !attr.ListDependentPropertyNames.IsNullOrEmpty())
            {
                //Raise property changed on any dependent properties.
                attr.ListDependentPropertyNames.ForEach(x => RaisePropertyChanged(x));
            }
        }