开发者

WPF event handler for minimizing a Ribbon?

开发者 https://www.devze.com 2023-03-23 01:34 出处:网络
Anyone know if the Ribbon control (using a Ribbon Window WPF project in VS 2010) has an event handler for when the tabs are minimized?

Anyone know if the Ribbon control (using a Ribbon Window WPF project in VS 2010) has an event handler for when the tabs are minimized?

I t开发者_开发知识库ried looking around the events but I couldn't find anything that worked.


I'm assuming you want the Ribbon.Collapsed event, or it's corresponding Expanded event.


Its IsMinimizedChanged in older version. I am using version 2.0 and had to disable minimize functionality on ribbon.

IsMinimizedChanged event is called when the minimize button on ribbon is clicked or someone double click on the tab.


I inherited the Ribbon and added the following code to detect if Ribbon is being minimized or maximized:

Event IsMinimizedChanged As EventHandler

Private mIsMinimized As Boolean

Protected Overrides Sub OnChildDesiredSizeChanged(child As UIElement)
    MyBase.OnChildDesiredSizeChanged(child)
    If TypeOf child Is Grid Then
        If Not mIsMinimized = IsMinimized Then
            RaiseEvent IsMinimizedChanged(Me, EventArgs.Empty)
            mIsMinimized = IsMinimized
        End If
    End If
End Sub
0

精彩评论

暂无评论...
验证码 换一张
取 消