Catel.LogAnalyzer.Behaviors.DropFileBehavior.CommandPropertyChangedCallBack C# (CSharp) Метод

CommandPropertyChangedCallBack() приватный статический Метод

The OnCommandChanged method. This event handles the initial binding and future binding changes to the bound ICommand
private static CommandPropertyChangedCallBack ( DependencyObject inDependencyObject, System.Windows.DependencyPropertyChangedEventArgs inEventArgs ) : void
inDependencyObject System.Windows.DependencyObject A DependencyObject
inEventArgs System.Windows.DependencyPropertyChangedEventArgs A DependencyPropertyChangedEventArgs object.
Результат void
        private static void CommandPropertyChangedCallBack(
            DependencyObject inDependencyObject, DependencyPropertyChangedEventArgs inEventArgs)
        {
            var uiElement = inDependencyObject as UIElement; // Remove the handler if it exist to avoid memory leaks
            if (uiElement != null)
            {
                uiElement.Drop -= UIElement_Drop;
            }

            var command = inEventArgs.NewValue as ICommand;
            if (command == null)
            {
                return;
            }
            // the property is attached so we attach the Drop event handler
            if (uiElement != null)
            {
                uiElement.Drop += UIElement_Drop;
            }
        }