C# Class Microsoft.Windows.Controls.Ribbon.RibbonMenuItem

Inheritance: System.Windows.Controls.MenuItem, ISyncKeyTipAndContent
Exibir arquivo Open project: kasicass/kasicass Class Usage Examples

Public Properties

Property Type Description
CanAddToQuickAccessToolBarDirectlyProperty System.Windows.DependencyProperty
CanUserResizeHorizontallyProperty System.Windows.DependencyProperty
CanUserResizeVerticallyProperty System.Windows.DependencyProperty
CheckedBackgroundProperty System.Windows.DependencyProperty
CheckedBorderBrushProperty System.Windows.DependencyProperty
DropDownHeightProperty System.Windows.DependencyProperty
HasGalleryProperty System.Windows.DependencyProperty
ImageSourceProperty System.Windows.DependencyProperty
IsDropDownPositionedLeftProperty System.Windows.DependencyProperty
ItemContainerTemplateSelectorProperty System.Windows.DependencyProperty
KeyTipProperty System.Windows.DependencyProperty
MouseOverBackgroundProperty System.Windows.DependencyProperty
MouseOverBorderBrushProperty System.Windows.DependencyProperty
PressedBackgroundProperty System.Windows.DependencyProperty
PressedBorderBrushProperty System.Windows.DependencyProperty
QuickAccessToolBarIdProperty System.Windows.DependencyProperty
QuickAccessToolBarImageSourceProperty System.Windows.DependencyProperty
RibbonProperty System.Windows.DependencyProperty
ToolTipDescriptionProperty System.Windows.DependencyProperty
ToolTipFooterDescriptionProperty System.Windows.DependencyProperty
ToolTipFooterImageSourceProperty System.Windows.DependencyProperty
ToolTipFooterTitleProperty System.Windows.DependencyProperty
ToolTipImageSourceProperty System.Windows.DependencyProperty
ToolTipTitleProperty System.Windows.DependencyProperty
UsesItemContainerTemplateProperty System.Windows.DependencyProperty

Private Properties

Property Type Description
BringIndexIntoView void
ClickItemInternal void
CloseSubmenu void
CoerceCanUserResizeProperty object
CoerceDropDownHeightProperty object
CoerceHeader object
CoerceKeyTip object
CoerceQuickAccessToolBarImageSource object
FocusOrSelect void
HandleLeftKeyDown bool
IsContainerFocusable bool
OnActivatingKeyTipThunk void
OnClickThrough void
OnClickThroughThunk void
OnContextMenuClosingInternal void
OnContextMenuClosingThunk void
OnContextMenuOpeningInternal void
OnContextMenuOpeningThunk void
OnDismissPopup void
OnDismissPopupThunk void
OnHasGalleryChanged void
OnHeaderChanged void
OnImageSourceChanged void
OnIsCheckedChanged void
OnIsSelectedChanged void
OnIsSelectedChanged void
OnIsSubmenuOpenChanged void
OnItemContainerGeneratorStatusChanged void
OnKeyTipAccessedThunk void
OnKeyTipChanged void
OnPopupOpened void
OnPopupResize void
OnPopupResizeStarted void
OpenSubmenu void
OpenSubmenuWithKeyboard void
PlacePopup System.Windows.Controls.Primitives.CustomPopupPlacement[]
ResizePopupInternal bool
RibbonMenuItem System
SetTimerToCloseSubmenu void
SetTimerToOpenSubmenu void
StartTimer void
StopTimer void
SyncKeyTipAndContent void
UpdateDropDownPosition object
UpdateIsPressed void

Public Methods

Method Description
OnApplyTemplate ( ) : void

Protected Methods

Method Description
ClearContainerForItemOverride ( DependencyObject element, object item ) : void
GetContainerForItemOverride ( ) : DependencyObject
IsItemItsOwnContainerOverride ( object item ) : bool
OnActivatingKeyTip ( ActivatingKeyTipEventArgs e ) : void
OnClick ( ) : void
OnCreateAutomationPeer ( ) : System.Windows.Automation.Peers.AutomationPeer
OnGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
OnIsKeyboardFocusWithinChanged ( System.Windows.DependencyPropertyChangedEventArgs e ) : void

Called when the focus is no longer on or within this element.

OnKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
OnKeyTipAccessed ( KeyTipAccessedEventArgs e ) : void
OnLostKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
OnMouseEnter ( System e ) : void

RibbonMenuItems are hosted directly in a Menu, therefore TopLevelHeader should behave same as SubmenuHeader In base MenuItem ToplevelHeaders are opened immediately, but we want them to be opened after MenuShowDelay delay Therefore reimplement base.OnMouseEnter here.

OnMouseLeave ( System e ) : void

base MenuItem closes submenu when mouse moves away. Therefore reimplement base.OnMouseLeave ourselves without closing submenu's.

OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
OnMouseLeftButtonUp ( System.Windows.Input.MouseButtonEventArgs e ) : void
OnPreviewKeyUp ( System.Windows.Input.KeyEventArgs e ) : void
PrepareContainerForItemOverride ( DependencyObject element, object item ) : void
ShouldApplyItemContainerStyle ( DependencyObject container, object item ) : bool

Private Methods

Method Description
BringIndexIntoView ( int index ) : void
ClickItemInternal ( ) : void
CloseSubmenu ( ) : void
CoerceCanUserResizeProperty ( DependencyObject d, object baseValue ) : object
CoerceDropDownHeightProperty ( DependencyObject d, object baseValue ) : object
CoerceHeader ( DependencyObject d, object baseValue ) : object
CoerceKeyTip ( DependencyObject d, object baseValue ) : object
CoerceQuickAccessToolBarImageSource ( DependencyObject d, object baseValue ) : object
FocusOrSelect ( ) : void

Focus this item or, if that fails, just mark it selected.

HandleLeftKeyDown ( DependencyObject originalSource ) : bool
IsContainerFocusable ( FrameworkElement container ) : bool
OnActivatingKeyTipThunk ( object sender, ActivatingKeyTipEventArgs e ) : void
OnClickThrough ( System.Windows.Input.MouseButtonEventArgs e ) : void
OnClickThroughThunk ( object sender, System.Windows.Input.MouseButtonEventArgs e ) : void
OnContextMenuClosingInternal ( ) : void
OnContextMenuClosingThunk ( object sender, System.Windows.Controls.ContextMenuEventArgs e ) : void
OnContextMenuOpeningInternal ( ) : void
OnContextMenuOpeningThunk ( object sender, System.Windows.Controls.ContextMenuEventArgs e ) : void
OnDismissPopup ( RibbonDismissPopupEventArgs e ) : void
OnDismissPopupThunk ( object sender, RibbonDismissPopupEventArgs e ) : void
OnHasGalleryChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnHeaderChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnImageSourceChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnIsCheckedChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnIsSelectedChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnIsSelectedChanged ( object sender, RoutedPropertyChangedEventArgs e ) : void

Called when IsSelected changed on this element or any descendant.

OnIsSubmenuOpenChanged ( DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnItemContainerGeneratorStatusChanged ( object sender, EventArgs e ) : void
OnKeyTipAccessedThunk ( object sender, KeyTipAccessedEventArgs e ) : void
OnKeyTipChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnPopupOpened ( object sender, EventArgs e ) : void

ToolTip is always opened as soon as the cursor moves over it, it stays invisible for the duration of the InitialShowDelay. Because the submenu popup is opened with a delay, it covers up the tooltip. To avoid this, we disable ToolTipService, however ToolTIp service does not close previously opened tooltips when it is disabled. So we need to force it closed as soon as the popup comes up.

OnPopupResize ( object sender, System.Windows.Controls.Primitives.DragDeltaEventArgs e ) : void
OnPopupResizeStarted ( object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e ) : void
OpenSubmenu ( ) : void
OpenSubmenuWithKeyboard ( ) : void
PlacePopup ( Size popupSize, Size targetSize, Point offset ) : System.Windows.Controls.Primitives.CustomPopupPlacement[]
ResizePopupInternal ( double newWidth, double newHeight ) : bool

Called from UIA Peers.

RibbonMenuItem ( ) : System

Initializes static members of the RibbonMenuItem class.

SetTimerToCloseSubmenu ( ) : void
SetTimerToOpenSubmenu ( ) : void
StartTimer ( DispatcherTimer timer ) : void
StopTimer ( DispatcherTimer &timer ) : void
SyncKeyTipAndContent ( ) : void
UpdateDropDownPosition ( object arg ) : object
UpdateIsPressed ( ) : void

Method Details

ClearContainerForItemOverride() protected method

protected ClearContainerForItemOverride ( DependencyObject element, object item ) : void
element System.Windows.DependencyObject
item object
return void

GetContainerForItemOverride() protected method

protected GetContainerForItemOverride ( ) : DependencyObject
return System.Windows.DependencyObject

IsItemItsOwnContainerOverride() protected method

protected IsItemItsOwnContainerOverride ( object item ) : bool
item object
return bool

OnActivatingKeyTip() protected method

protected OnActivatingKeyTip ( ActivatingKeyTipEventArgs e ) : void
e ActivatingKeyTipEventArgs
return void

OnApplyTemplate() public method

public OnApplyTemplate ( ) : void
return void

OnClick() protected method

protected OnClick ( ) : void
return void

OnCreateAutomationPeer() protected method

protected OnCreateAutomationPeer ( ) : System.Windows.Automation.Peers.AutomationPeer
return System.Windows.Automation.Peers.AutomationPeer

OnGotKeyboardFocus() protected method

protected OnGotKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
e System.Windows.Input.KeyboardFocusChangedEventArgs
return void

OnIsKeyboardFocusWithinChanged() protected method

Called when the focus is no longer on or within this element.
protected OnIsKeyboardFocusWithinChanged ( System.Windows.DependencyPropertyChangedEventArgs e ) : void
e System.Windows.DependencyPropertyChangedEventArgs
return void

OnKeyDown() protected method

protected OnKeyDown ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs
return void

OnKeyTipAccessed() protected method

protected OnKeyTipAccessed ( KeyTipAccessedEventArgs e ) : void
e KeyTipAccessedEventArgs
return void

OnLostKeyboardFocus() protected method

protected OnLostKeyboardFocus ( System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void
e System.Windows.Input.KeyboardFocusChangedEventArgs
return void

OnMouseEnter() protected method

RibbonMenuItems are hosted directly in a Menu, therefore TopLevelHeader should behave same as SubmenuHeader In base MenuItem ToplevelHeaders are opened immediately, but we want them to be opened after MenuShowDelay delay Therefore reimplement base.OnMouseEnter here.
protected OnMouseEnter ( System e ) : void
e System
return void

OnMouseLeave() protected method

base MenuItem closes submenu when mouse moves away. Therefore reimplement base.OnMouseLeave ourselves without closing submenu's.
protected OnMouseLeave ( System e ) : void
e System
return void

OnMouseLeftButtonDown() protected method

protected OnMouseLeftButtonDown ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs
return void

OnMouseLeftButtonUp() protected method

protected OnMouseLeftButtonUp ( System.Windows.Input.MouseButtonEventArgs e ) : void
e System.Windows.Input.MouseButtonEventArgs
return void

OnPreviewKeyUp() protected method

protected OnPreviewKeyUp ( System.Windows.Input.KeyEventArgs e ) : void
e System.Windows.Input.KeyEventArgs
return void

PrepareContainerForItemOverride() protected method

protected PrepareContainerForItemOverride ( DependencyObject element, object item ) : void
element System.Windows.DependencyObject
item object
return void

ShouldApplyItemContainerStyle() protected method

protected ShouldApplyItemContainerStyle ( DependencyObject container, object item ) : bool
container System.Windows.DependencyObject
item object
return bool

Property Details

CanAddToQuickAccessToolBarDirectlyProperty public_oe static_oe property

DependencyProperty for CanAddToQuickAccessToolBarDirectly property.
public static DependencyProperty,System.Windows CanAddToQuickAccessToolBarDirectlyProperty
return System.Windows.DependencyProperty

CanUserResizeHorizontallyProperty public_oe static_oe property

public static DependencyProperty,System.Windows CanUserResizeHorizontallyProperty
return System.Windows.DependencyProperty

CanUserResizeVerticallyProperty public_oe static_oe property

public static DependencyProperty,System.Windows CanUserResizeVerticallyProperty
return System.Windows.DependencyProperty

CheckedBackgroundProperty public_oe static_oe property

DependencyProperty for CheckedBackground property.
public static DependencyProperty,System.Windows CheckedBackgroundProperty
return System.Windows.DependencyProperty

CheckedBorderBrushProperty public_oe static_oe property

DependencyProperty for CheckedBorderBrush property.
public static DependencyProperty,System.Windows CheckedBorderBrushProperty
return System.Windows.DependencyProperty

DropDownHeightProperty public_oe static_oe property

public static DependencyProperty,System.Windows DropDownHeightProperty
return System.Windows.DependencyProperty

HasGalleryProperty public_oe static_oe property

public static DependencyProperty,System.Windows HasGalleryProperty
return System.Windows.DependencyProperty

ImageSourceProperty public_oe static_oe property

DependencyProperty for ImageSource property.
public static DependencyProperty,System.Windows ImageSourceProperty
return System.Windows.DependencyProperty

IsDropDownPositionedLeftProperty public_oe static_oe property

public static DependencyProperty,System.Windows IsDropDownPositionedLeftProperty
return System.Windows.DependencyProperty

ItemContainerTemplateSelectorProperty public_oe static_oe property

DependencyProperty for ItemContainerTemplateSelector property.
public static DependencyProperty,System.Windows ItemContainerTemplateSelectorProperty
return System.Windows.DependencyProperty

KeyTipProperty public_oe static_oe property

DependencyProperty for KeyTip property.
public static DependencyProperty,System.Windows KeyTipProperty
return System.Windows.DependencyProperty

MouseOverBackgroundProperty public_oe static_oe property

DependencyProperty for MouseOverBackground property.
public static DependencyProperty,System.Windows MouseOverBackgroundProperty
return System.Windows.DependencyProperty

MouseOverBorderBrushProperty public_oe static_oe property

DependencyProperty for MouseOverBorderBrush property.
public static DependencyProperty,System.Windows MouseOverBorderBrushProperty
return System.Windows.DependencyProperty

PressedBackgroundProperty public_oe static_oe property

DependencyProperty for PressedBackground property.
public static DependencyProperty,System.Windows PressedBackgroundProperty
return System.Windows.DependencyProperty

PressedBorderBrushProperty public_oe static_oe property

DependencyProperty for PressedBorderBrush property.
public static DependencyProperty,System.Windows PressedBorderBrushProperty
return System.Windows.DependencyProperty

QuickAccessToolBarIdProperty public_oe static_oe property

DependencyProperty for QuickAccessToolBarId property.
public static DependencyProperty,System.Windows QuickAccessToolBarIdProperty
return System.Windows.DependencyProperty

QuickAccessToolBarImageSourceProperty public_oe static_oe property

DependencyProperty for QuickAccessToolBarImageSource property.
public static DependencyProperty,System.Windows QuickAccessToolBarImageSourceProperty
return System.Windows.DependencyProperty

RibbonProperty public_oe static_oe property

DependencyProperty for Ribbon property.
public static DependencyProperty,System.Windows RibbonProperty
return System.Windows.DependencyProperty

ToolTipDescriptionProperty public_oe static_oe property

DependencyProperty for ToolTipDescription property.
public static DependencyProperty,System.Windows ToolTipDescriptionProperty
return System.Windows.DependencyProperty

ToolTipFooterDescriptionProperty public_oe static_oe property

DependencyProperty for ToolTipFooterDescription property.
public static DependencyProperty,System.Windows ToolTipFooterDescriptionProperty
return System.Windows.DependencyProperty

ToolTipFooterImageSourceProperty public_oe static_oe property

DependencyProperty for ToolTipFooterImageSource property.
public static DependencyProperty,System.Windows ToolTipFooterImageSourceProperty
return System.Windows.DependencyProperty

ToolTipFooterTitleProperty public_oe static_oe property

DependencyProperty for ToolTipFooterTitle property.
public static DependencyProperty,System.Windows ToolTipFooterTitleProperty
return System.Windows.DependencyProperty

ToolTipImageSourceProperty public_oe static_oe property

DependencyProperty for ToolTipImageSource property.
public static DependencyProperty,System.Windows ToolTipImageSourceProperty
return System.Windows.DependencyProperty

ToolTipTitleProperty public_oe static_oe property

DependencyProperty for ToolTipTitle property.
public static DependencyProperty,System.Windows ToolTipTitleProperty
return System.Windows.DependencyProperty

UsesItemContainerTemplateProperty public_oe static_oe property

DependencyProperty for UsesItemContainerTemplate property.
public static DependencyProperty,System.Windows UsesItemContainerTemplateProperty
return System.Windows.DependencyProperty