Observes <TParameter1, TParameter2, TResult>(
            [NotNull] TParameter1 parameter1,
            [NotNull] TParameter2 parameter2,
            [NotNull] Expression <Func <TParameter1, TParameter2, TResult> > propertyExpression,
            bool autoSubscribe,
            [NotNull] Action <TResult> action,
            [NotNull] TResult fallback)
            where TParameter1 : INotifyPropertyChanged
            where TParameter2 : INotifyPropertyChanged
        {
            var observer = new PropertyObserverWithFallback <TParameter1, TParameter2, TResult>(
                parameter1,
                parameter2,
                propertyExpression,
                action,
                fallback,
                PropertyObserverFlag.None);

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

            return(observer);
        }
コード例 #2
0
        public static IPropertyObserverWithFallback <TResult> Observes <TResult>(
            [NotNull] Expression <Func <TResult> > propertyExpression,
            bool autoSubscribe,
            [NotNull] Action <TResult> action,
            [NotNull] TResult fallback)
        {
            var observer = new PropertyObserverWithFallback <TResult>(propertyExpression, action, fallback, PropertyObserverFlag.None);

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

            return(observer);
        }