コード例 #1
0
 /// <summary>
 /// Creates the trigger property.
 /// </summary>
 /// <param name="onPropertyChanged">A method that raises <see cref="INotifyPropertyChanged.PropertyChanged"/>.</param>
 /// <param name="initialValue">The optional initial value of the property.</param>
 /// <param name="comparer">The optional comparer used to determine when the value of the property has changed.</param>
 public TriggerProperty(Action <PropertyChangedEventArgs> onPropertyChanged, T initialValue = default(T), IEqualityComparer <T> comparer = null)
 {
     _sourceProperty = new SourceProperty(onPropertyChanged);
     _comparer       = comparer ?? EqualityComparer <T> .Default;
     _value          = initialValue;
     Attach(_value);
 }
コード例 #2
0
 /// <summary>
 /// Creates a debug view for the specified property.
 /// </summary>
 /// <param name="property">The property to examine.</param>
 public DebugView(SourceProperty property)
 {
     _property = property;
 }
コード例 #3
0
 /// <summary>
 /// Creates the calculated property.
 /// </summary>
 /// <param name="onPropertyChanged">A method that raises <see cref="INotifyPropertyChanged.PropertyChanged"/>.</param>
 /// <param name="calculateValue">The delegate used to calculate the property value.</param>
 public CalculatedProperty(Action <PropertyChangedEventArgs> onPropertyChanged, Func <T> calculateValue)
 {
     _sourceProperty = new SourceProperty(onPropertyChanged);
     _calculateValue = calculateValue;
     _sources        = new HashSet <ISourceProperty>();
 }