Ejemplo n.º 1
0
        /// <summary>
        /// Sets the value of the notifying property.
        /// </summary>
        /// <param name="notifyingProperty">The notifying property.</param>
        /// <param name="value">The value to set.</param>
        /// <param name="forceUpdate">If set to <c>true</c> we'll force an update
        /// of the binding by calling NotifyPropertyChanged.</param>
        protected void SetValue(NotifyingProperty notifyingProperty, object value, bool forceUpdate = false)
        {
            //  We'll only set the value and notify that it has changed if the
            //  value is different - or if we are forcing an update.
            if (notifyingProperty.Value != value || forceUpdate)
            {
                //  Set the value.
                notifyingProperty.Value = value;

                //  Notify that the property has changed.
                NotifyPropertyChanged(notifyingProperty.Name);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sets the value of the notifying property.
        /// </summary>
        /// <param name="notifyingProperty">The notifying property.</param>
        /// <param name="value">The value to set.</param>
        /// <param name="forceUpdate">If set to <c>true</c> we'll force an update
        /// of the binding by calling NotifyPropertyChanged.</param>
        protected void SetValue(NotifyingProperty notifyingProperty, object value, bool forceUpdate = false)
        {
            //  We'll only set the value and notify that it has changed if the
            //  value is different - or if we are forcing an update.
            if (notifyingProperty.Value != value || forceUpdate)
            {
                //  Set the value.
                notifyingProperty.Value = value;

                //  Notify that the property has changed.
                NotifyPropertyChanged(notifyingProperty.Name);
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the value of a notifying property.
 /// </summary>
 /// <param name="notifyingProperty">The notifying property.</param>
 /// <returns>The value of the notifying property.</returns>
 protected object GetValue(NotifyingProperty notifyingProperty)
 {
     return notifyingProperty.Value;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Sets the value of the notifying property.
 /// </summary>
 /// <param name="notifyingProperty">The notifying property.</param>
 /// <param name="value">The value to set.</param>
 protected void SetValue(NotifyingProperty notifyingProperty, object value)
 {
     //  Call SetValue without forcing an update.
     SetValue(notifyingProperty, value, false);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Gets the value of a notifying property.
 /// </summary>
 /// <param name="notifyingProperty">The notifying property.</param>
 /// <returns>The value of the notifying property.</returns>
 protected object GetValue(NotifyingProperty notifyingProperty)
 {
     return(notifyingProperty.Value);
 }