src/GenFx.Wpf/Controls/ExecutionPanel.xaml.cs
/// <summary>
/// Handles the event when the <see cref="ExecutionContext"/> property changes.
/// </summary>
/// <param name="obj">The <see cref="DependencyObject"/> that owns the property.</param>
/// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> associated with the event.</param>
Handles the event when the  property changes.
Handles the event when the property changes .
private static void OnExecutionContextChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ExecutionPanel panel = (ExecutionPanel)obj;
            if (e.OldValue != null)
            {
                ((ExecutionContext)e.OldValue).PropertyChanged -= panel.ExecutionContext_PropertyChanged;
                panel.ViewModel?.Dispose();
            }
            if (e.NewValue != null)
            {
                ExecutionContext executionContext = (ExecutionContext)e.NewValue;
                panel.ViewModel = new ExecutionPanelViewModel(executionContext);
                executionContext.PropertyChanged += panel.ExecutionContext_PropertyChanged;
                panel.UpdateCanExecuteProperties();
            }
        }
private static void OnExecutionContextChanged ( DependencyObject obj , DependencyPropertyChangedEventArgs e ) { ExecutionPanel panel = ( ExecutionPanel ) obj ; if ( e . OldValue != null ) { ( ( ExecutionContext ) e . OldValue ) . PropertyChanged -= panel . ExecutionContext_PropertyChanged ; panel . ViewModel ? . Dispose ( ) ; } if ( e . NewValue != null ) { ExecutionContext executionContext = ( ExecutionContext ) e . NewValue ; panel . ViewModel = new ExecutionPanelViewModel ( executionContext ) ; executionContext . PropertyChanged += panel . ExecutionContext_PropertyChanged ; panel . UpdateCanExecuteProperties ( ) ; } }
Handles the event when the  property changes.
Handles the event when the property changes .
obj
DependencyObject
The  that owns the property.
The that owns the property .
e
DependencyPropertyChangedEventArgs
The  associated with the event.
The associated with the event .