Exemple #1
0
        public static IPropertyValueObserver <TResult> Observes <TResult>(
            [NotNull] Expression <Func <TResult> > propertyExpression,
            bool isAutoActivate,
            [NotNull] Action <TResult?> action)
            where TResult : struct
        {
            var observer = new PropertyValueObserver <TResult>(propertyExpression, action, PropertyObserverFlag.None);

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

            return(observer);
        }
        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 : struct
        {
            var observer = new PropertyValueObserver <TParameter1, TParameter2, TResult>(
                parameter1,
                parameter2,
                propertyExpression,
                action, PropertyObserverFlag.None);

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

            return(observer);
        }