ContextMenu IsItemItsOwnContainerOverride

Ribbon for WPF Forum

Posted 15 years ago by Owen Christensen - Software Engineer, Minitab Inc.
Version: 4.5.0486
Platform: .NET 3.5
Environment: Windows Vista (64-bit)
Avatar
IsItemItsOwnContainerOverride is overridden in the ContextMenu in the RibbonControls.
This always returns true meaning items cannot be templated.

Comments (3)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Owen,

Yes that is true because ribbon:ContextMenu inherits the standard WPF ContextMenu and we don't want standard MenuItem wrappers to be generated. Instead, you should probably include a ribbon:Menu as the child control of the ribbon:ContextMenu and bind to that.


Actipro Software Support

Posted 15 years ago by Owen Christensen - Software Engineer, Minitab Inc.
Avatar
Why not use GetContainerForItemOverride and provide your own subclass of MenuItem (or ribbon:Button given it already exists and is the most common use case for your stuff?)

[Modified at 04/02/2009 09:45 AM]
Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Owen,

We don't want any of the functionality that the standard MDI MenuItem introduces. Our ribbon:ContextMenu is designed to allow for direct inclusion of child controls without unwanted behavior that wrapping with MenuItem causes. This allows us to add things like the ribbon:Menu control and have complex layouts, while still allowing ribbon:ContextMenu to be used anywhere a standard ContextMenu can be used.

While we could have put ribbon:Menu functionality directly in ribbon:ContextMenu instead, as a design decision we chose not to because that would have prevented more complicated layouts as displayed in some of our QuickStarts.


Actipro Software Support

The latest build of this product (v24.1.1) was released 21 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.