src/Foundation/Presentation/Gimela.Presentation.Controls/Controls/MDI/MDIChild.cs
/// <summary>
/// Dependency property event once the minimize box value has changed.
/// </summary>
/// <param name="sender">The sender.</param>
/// <param name="e">The <see cref="System.Windows.DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
Dependency property event once the minimize box value has changed.
Dependency property event once the minimize box value has changed .
private static void MinimizeBoxValueChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
    {
      MDIChild mdiChild = (MDIChild)sender;
      bool visible = (bool)e.NewValue;
      if (visible)
      {
        bool maximizeVisible = true;
        if (mdiChild.maximizeButton != null)
          maximizeVisible = mdiChild.maximizeButton.Visibility == Visibility.Visible;
        if (mdiChild.minimizeButton != null)
          mdiChild.minimizeButton.IsEnabled = true;
        if (!maximizeVisible)
        {
          if (mdiChild.maximizeButton != null)
            mdiChild.minimizeButton.Visibility = Visibility.Visible;
          if (mdiChild.maximizeButton != null)
            mdiChild.maximizeButton.Visibility = Visibility.Visible;
        }
      }
      else
      {
        bool maximizeEnabled = true;
        if (mdiChild.maximizeButton != null)
          maximizeEnabled = mdiChild.maximizeButton.IsEnabled;
        if (mdiChild.minimizeButton != null)
          mdiChild.minimizeButton.IsEnabled = false;
        if (!maximizeEnabled)
        {
          if (mdiChild.minimizeButton != null)
            mdiChild.minimizeButton.Visibility = Visibility.Hidden;
          if (mdiChild.maximizeButton != null)
            mdiChild.maximizeButton.Visibility = Visibility.Hidden;
        }
      }
    }
private static void MinimizeBoxValueChanged ( DependencyObject sender , DependencyPropertyChangedEventArgs e ) { MDIChild mdiChild = ( MDIChild ) sender ; bool visible = ( bool ) e . NewValue ; if ( visible ) { bool maximizeVisible = true ; if ( mdiChild . maximizeButton != null ) maximizeVisible = mdiChild . maximizeButton . Visibility == Visibility . Visible ; if ( mdiChild . minimizeButton != null ) mdiChild . minimizeButton . IsEnabled = true ; if ( ! maximizeVisible ) { if ( mdiChild . maximizeButton != null ) mdiChild . minimizeButton . Visibility = Visibility . Visible ; if ( mdiChild . maximizeButton != null ) mdiChild . maximizeButton . Visibility = Visibility . Visible ; } } else { bool maximizeEnabled = true ; if ( mdiChild . maximizeButton != null ) maximizeEnabled = mdiChild . maximizeButton . IsEnabled ; if ( mdiChild . minimizeButton != null ) mdiChild . minimizeButton . IsEnabled = false ; if ( ! maximizeEnabled ) { if ( mdiChild . minimizeButton != null ) mdiChild . minimizeButton . Visibility = Visibility . Hidden ; if ( mdiChild . maximizeButton != null ) mdiChild . maximizeButton . Visibility = Visibility . Hidden ; } } }
Dependency property event once the minimize box value has changed.
Dependency property event once the minimize box value has changed .
sender
DependencyObject
None
e
DependencyPropertyChangedEventArgs
The  instance containing the event data.
The instance containing the event data .