コード例 #1
0
		/// <summary>
		/// Initializes a new instance of the <see cref="PropertyPathMonitor"/> class.
		/// </summary>
		/// <param name="methodFactory">The method factory.</param>
		/// <param name="notifier">The notifier.</param>
		/// <param name="propertyPath">The property path.</param>
		/// <param name="onPathChanged">The on path changed.</param>
		public PropertyPathMonitor(IMethodFactory methodFactory, INotifyPropertyChanged notifier, string propertyPath, IChangeMonitorNode parentMonitor)
		{
			_methodFactory = methodFactory;
			_notifierRef = new WeakReference(notifier);
			_parentMonitorRef = new WeakReference(parentMonitor);
			_propertyPath = propertyPath;

			_observedPropertyName = GetRootProperty(_propertyPath);
			_subPath = GetSubPath(_propertyPath);

			VerifyObservedPropertyExists();

			notifier.PropertyChanged += Notifier_PropertyChanged;
			HookSubpathMonitor();
		}
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="PropertyPathMonitor"/> class.
        /// </summary>
        /// <param name="methodFactory">The method factory.</param>
        /// <param name="notifier">The notifier.</param>
        /// <param name="propertyPath">The property path.</param>
        /// <param name="parentMonitor">The parent monitor.</param>
        public PropertyPathMonitor(IMethodFactory methodFactory, INotifyPropertyChanged notifier, string propertyPath, IChangeMonitorNode parentMonitor)
        {
            this.methodFactory = methodFactory;
            notifierRef        = new WeakReference(notifier);
            parentMonitorRef   = new WeakReference(parentMonitor);
            this.propertyPath  = propertyPath;

            observedPropertyName = GetRootProperty(this.propertyPath);
            subPath = GetSubPath(this.propertyPath);

            VerifyObservedPropertyExists();

            notifier.PropertyChanged += Notifier_PropertyChanged;
            HookSubpathMonitor();
        }