windowsforms-devexpress-dot-xtrabars-dot-navigation-dot-navigationframe.md
Allows you to dynamically assign content to each NavigationPage in this NavigationFrame or NavigationPane.
Namespace : DevExpress.XtraBars.Navigation
Assembly : DevExpress.XtraBars.v25.2.dll
NuGet Package : DevExpress.Win.Navigation
[DXCategory("Deferred Control Load Events")]
public event QueryControlEventHandler QueryControl
<DXCategory("Deferred Control Load Events")>
Public Event QueryControl As QueryControlEventHandler
The QueryControl event's data class is DevExpress.XtraBars.Navigation.QueryControlEventArgs.
The QueryControl event fires whenever a blank NavigationPage has to be displayed. When handling this event, use the e.Page property to determine which page fired this event and the e.Control property to assign a content for this page. For instance, the following code illustrates an example.
private void navigationPane1_QueryControl(object sender, DevExpress.XtraBars.Navigation.QueryControlEventArgs e) {
if (e.Page == myPage1) e.Control = new myXtraUserControl();
}
Private Sub navigationPane1_QueryControl(ByVal sender As Object, ByVal e As DevExpress.XtraBars.Navigation.QueryControlEventArgs)
If e.Page = myPage1 Then
e.Control = New myXtraUserControl()
End If
End Sub
Dynamic page population in a navigation frame and navigation page is identical to populating documents that belong to the Application UI Manager component. See the Deferred Load topic to learn more.
When a page populated on the QueryControl event is deselected, the NavigationFrame.ControlReleasing event is raised.
See Also