Beispiel #1
0
        /// <summary>
        /// Creates the specified owner.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="propertyExpression">The property expression.</param>
        /// <returns>The Property Observer.</returns>
        public static PropertyObserver <TParameter1, TResult> Create(
            [NotNull] TParameter1 owner,
            [NotNull] Expression <Func <TParameter1, TResult> > propertyExpression)
        {
            var instance = new PropertyObserver <TParameter1, TResult>(owner, propertyExpression);

            instance.Subscribe();
            return(instance);
        }
Beispiel #2
0
        public static PropertyObserver <TType> Create <TType>([NotNull] Expression <Func <TType> > propertyExpression)
        {
            if (propertyExpression == null)
            {
                throw new ArgumentNullException(nameof(propertyExpression));
            }
            var instance = new PropertyObserver <TType>(propertyExpression);

            instance.Subscribe();
            return(instance);
        }