コード例 #1
0
        public static IPropertyObserver <TResult> Observes <TResult>(
            [NotNull] Expression <Func <TResult> > propertyExpression,
            bool autoSubscribe,
            [NotNull] Action action)
        {
            var observer = new PropertyObserver <TResult>(propertyExpression, action, PropertyObserverFlag.None);

            if (autoSubscribe)
            {
                observer.Activate(true);
            }

            return(observer);
        }
        public static IPropertyObserver <TResult> Observes <TParameter1, TResult>(
            [NotNull] this TParameter1 parameter1,
            [NotNull] Expression <Func <TParameter1, TResult> > propertyExpression,
            bool autoSubscribe,
            [NotNull] Action action)
            where TParameter1 : INotifyPropertyChanged
        {
            var observer = new PropertyObserver <TParameter1, TResult>(parameter1, propertyExpression, action, PropertyObserverFlag.None);

            if (autoSubscribe)
            {
                observer.Activate(true);
            }

            return(observer);
        }