The peek window allows you to show a control as the user hovers over any item within the WinOfficeNavBar. The peek window features the following parts:
PeekContent—features the control assigned to the peek window, and displays the majority of the UI that the peek window will convey. The content control is assigned to the PeekContent property on the NavBarItem or the eventArgs of the PeekOpening event.
PeekContent property
ultraOfficeNavBar1.Items[0].PeekContent = ultraGrid1;
PeekOpening event
private void ultraOfficeNavBar1_PeekOpening(object sender, PeekOpeningEventArgs e)
{
e.PeekContent = ultraGrid1;
}
The PeekContent is the minimum requirement for an NavBarItem’s peek window to show; a peek window will show without a caption or left/right buttons, but no window will show as long as the PeekContent is not set.
PeekCaption—specifies the text displayed at the top of the Peek window. This is done by setting the PeekCaption property on the NavBarItem.
Left/Right PeekCaptionButtons—Peek caption buttons can be displayed at the top of the Peek window to provide additional functionality.
PeekCaptionButtonsLeft
and
PeekCaptionButtonsRight
collections are exposed off the
ItemSettings
class. Any
EditorButtons
added to these collections are displayed at the top of the Peek window. Additionally, clicking any
EditorButton
in these collections will fire the
PeekCaptionButtonClicked
event on the WinOfficeNavBar control.
Note: PeekCaptionEditorButton collection are not merged; For example, if buttons are added to the PeekCaptionButtonsLeft collection on the ItemSettings of both the NavBarItem and the WinOfficeNavBar, only the buttons in the collection off of the NavBarItem’s ItemSettings will be displayed.
The following is an example of adding a button to the left collection:
to the WinOfficeNavBar:
var leftButton = new PeekCaptionEditorButton() { Key = "left" };
ultraOfficeNavBar1.ItemSettings.PeekCaptionButtonsLeft.Add(leftButton);
to the NavBarItem:
var leftButton = new PeekCaptionEditorButton() { Key = "left" };
ultraOfficeNavBar1.Items[0].Settings.PeekCaptionButtonsLeft.Add(leftButton);
The peek window can be suppressed by setting DisplayPeekOnHover to false.