Friday, February 13, 2015

FlexRibbonMenu


FlexRibbonMenu class
Represents a Windows ribbon menu control that enables you to hierarchically organize elements associated with commands and event handlers.
Examples
The following example shows how to create a FlexRibbonMenu object.
public partial class MyRibbonMenu : FlexRibbonMenu
{
// ***** //
public partial class Window1 : LinsMDIWindow
{
public Window1()
{
InitializeComponent();

// Create a ribbon menu instance.
MainRibbonMenu = new MyRibbonMenu();
// Show the ribbon menu.
MainRibbonMenu.ShowMenu();
}
}
§  Constructors
1)  public FlexRibbonMenu()
Remarks
Initialize a new instance of FlexRibbonMenu
§  Members
1)  public virtual Rect Bounds { get; }
Remarks
Retrieve both the size and the location of the ribbon menu, in pixels, relative to its parent.
2)  public virtual Rect BoundsAtMDIFrame { get; }
Remarks
Retrieve both the size and the location of the ribbon menu, in pixels, relative to MDI frame.
3)  public virtual long ID { get; set; }               
Remarks
Every FlexRibbonMenu object should have a unique ID. If the user does not assign a number to the ID, a unique number which is larger than FlexConstants.m_nUserDefinedControlStartID (10,000,000) will be automatically generated and assigned to it. If the ID is between FlexConstants.m_nUserDefinedControlStartID (1000) and FlexConstants.m_nUserDefinedControlStartID (10,000,000), then once the ribbon menu is created, it will never been destroyed, and its layout will be persistent and customizable. You can always use LinsUIWPFDockingManager.GetRibbonMenuFromAllPlacesByID() to retrieve its instance, once it is created.
4)  public FlexCollection<UIElement> Items { get; set; }               
Remarks
Gets or set all ribbon menu items, in most of case, tabs which will contains sub menu items.
5)  public bool Pinned { get; set; }
Remarks
If it is true, then the ribbon panel for the active tab will be always visible; otherwise, active ribbon panel will be hidden until one tab is clicked.
6)  public virtual int SelectedIndex { get; }
Remarks
Retrieves the index of the selected tab.
7)  public virtual FlexRibbonMenuTab SelectedTab { get; }
Remarks
Retrieve the selected tab.
8)  public bool ShowToolTip { get; set; }
Remarks
This field decided if the tooltip will be shown, when the mouse hovers above one of ribbon menu items, if the menu item has a tooltip assigned to it.
9)  public string Text { get; set; }
Remarks
Gets or sets the caption of the ribbon menu.
§  Methods
1)  public void EnsureVisible(
FlexToolBarBaseButton visibleButton)      
Parameters
visibleButton
Type: FlexToolBarBaseButton
A ribbon menu item, in most of case, tab.            
Remarks
Move the ribbon menu item, visibleButton, into view area if it is outside the view area.
2)  public virtual bool HitTest(
Point ptMousePosAtMDIFrame)                 
Parameters
ptMousePosAtMDIFrame
Type: Point
A location which is in MDI Frame coordinate. 
Remarks
Test whether the point, ptMousePosAtMDIFrame, which is in MDI Frame coordinate, is inside this ribbon menu.
3)  public virtual Size MeasureSize()              
Remarks
This calculates how much space the ribbon menu requires. If the user wants to customize the ribbon menu, this method may need to be overridden by the user.
4)  public virtual bool ShowMenu()              
Remarks
This make the FlexRibbonMenu object visible. 
§  Events
1)     public event NotifyCollectionChangedEventHandler VisualChildrenChanged              
Remarks
This event is fired when any menu item (tab) is added or removed from the ribbon menu.  

References:
Command,
Command Events,
Commands Manager,
Create a Command,
Create a Ribbon Menu,
Dynamically Link a Tool Item to a Command Existed in an Optional Assembly,
Features,
How To,
Index,
Instruction,
LinsUIWPFDockingManager,
Tool Items Manager

No comments:

Post a Comment