コード例 #1
0
        public void RegisterPropertyChangedHandler <TProperty>(Expression <Func <object, TProperty> > viewModelProperty, EventHandler propertyChangedEventHandler)
        {
            string name = MemberNameUtil.GetPropertyName(viewModelProperty);
            var    prop = PropertyCache.GetProperty(name, this.GetType(), autoRegister: true);

            RegisterPropertyChangedHandler(prop, propertyChangedEventHandler);
        }
コード例 #2
0
        public void ReleasePropertyChangedHandler <TProperty>(Expression <Func <object, TProperty> > viewModelProperty, EventHandler propertyChangedEventHandler)
        {
            string name = MemberNameUtil.GetPropertyName(viewModelProperty);
            var    prop = PropertyCache.GetProperty(name, this.GetType(), autoRegister: false);

            if (prop == null)
            {
                throw new InvalidOperationException("Property not registered! Name:" + name + ". ErrorID:{EC7E3C09-2ED6-4D44-B6F2-4444C4DF7CB3}");
            }
            ReleasePropertyChangedHandler(prop, propertyChangedEventHandler);
        }