ContentItem.FocusContentOnActivating Property
Gets or sets whether the ContentItem‘s content should be focused on ContentItem activation.
Namespace: DevExpress.Xpf.Docking
Assembly: DevExpress.Xpf.Docking.v24.1.dll
NuGet Package: DevExpress.Wpf.Docking
Declaration
Property Value
Type | Description |
---|---|
Boolean | true, if the ContentItem‘s content should be focused on ContentItem activation; otherwise, false. |
Remarks
By default, when a ContentItem is selected, its content is automatically focused and there is no need for an end-user to manually focus it. To override this default behavior, set the FocusContentOnActivating property to false.
For example, the following code creates a DockLayoutManager with one DocumentGroup that contains two tabbed DocumentPanels. Each panel contains a RichTextBox control. In this example the FocusContentOnActivating property specifies whether a RichTextBox control will be focused upon its parent panel activation.
<dxdo:DockLayoutManager>
<dxdo:LayoutGroup>
<dxdo:DocumentGroup x:Name="documentGroup1" SelectedTabIndex="1">
<dxdo:DocumentPanel IsActive="True" x:Name="document1" Caption="Document 1" FocusContentOnActivating="False">
<RichTextBox>
<FlowDocument>
<Paragraph>
This text box is not focused automatically
</Paragraph>
</FlowDocument>
</RichTextBox>
</dxdo:DocumentPanel>
<dxdo:DocumentPanel x:Name="document2" Caption="Document 2" FocusContentOnActivating="True">
<RichTextBox>
<FlowDocument>
<Paragraph>
This text box is focused when its parent DocumentPanel is activated
</Paragraph>
</FlowDocument>
</RichTextBox>
</dxdo:DocumentPanel>
</dxdo:DocumentGroup>
</dxdo:LayoutGroup>
</dxdo:DockLayoutManager>
The animation below illustrates the result.
To activate a ContentItem, use the BaseLayoutItem.IsActive property or the DockLayoutManager.Activate method.