/// <summary> /// Releases unmanaged and - optionally - managed resources. /// </summary> /// <param name="disposing"> /// <c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only /// unmanaged resources. /// </param> protected virtual void Dispose(bool disposing) { if (disposing) { if (_Behavior != null) { _Behavior.Dispose(); _Behavior = null; } } }
/// <summary> /// Sets the Behavior property. /// </summary> private static void SetBehavior(DependencyObject d, CommandBehaviorBinding value) { d.SetValue(BehaviorProperty, value); }
/// <summary> /// Handles changes to the CommandParameter property. /// </summary> private static void OnCommandParameterChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CommandBehaviorBinding binding = GetOrCreateBinding(d); binding.CommandParameter = e.NewValue; }