public static IPropertyReferenceObserver <TResult> Observes <TResult>(
            [NotNull] Expression <Func <TResult> > propertyExpression,
            bool isAutoActivate,
            [NotNull] Action <TResult?> action)
            where TResult : class
        {
            var observer = new PropertyReferenceObserver <TResult>(propertyExpression, action, PropertyObserverFlag.None);

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

            return(observer);
        }
Exemple #2
0
        Observes <TParameter1, TParameter2, TResult>(
            [NotNull] TParameter1 parameter1,
            [NotNull] TParameter2 parameter2,
            [NotNull] Expression <Func <TParameter1, TParameter2, TResult> > propertyExpression,
            bool isAutoActivate,
            [NotNull] Action <TResult?> action)
            where TParameter1 : INotifyPropertyChanged
            where TParameter2 : INotifyPropertyChanged
            where TResult : class
        {
            var observer = new PropertyReferenceObserver <TParameter1, TParameter2, TResult>(
                parameter1,
                parameter2,
                propertyExpression,
                action, PropertyObserverFlag.None);

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

            return(observer);
        }