David
David

Reputation: 4117

Disable minimize or maximize when double clicked on ribbon

I use the Ribbon for WPF (2010 - Microsoft.Windows.Controls.Ribbon).

How can I disable the minimize or maximize effect from the red range, when I do a double click on the tab (header)

enter image description here

Upvotes: 3

Views: 2223

Answers (1)

Xcalibur37
Xcalibur37

Reputation: 2323

Use this event on the SizeChanged property of the ribbon to suppress minimizing.

/// <summary>
/// Disable the minimize functionality of the ribbon.
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void RibbonSizeChanged(object sender, SizeChangedEventArgs e)
{
    var ribbon = sender as Ribbon;
    if (ribbon != null)
    {
        ribbon.IsMinimized = false;
    }

    // Handled
    e.Handled = true;
}

Upvotes: 8

Related Questions