BarItem.Links Property
Gets the collection of links that refer to the current item.
Namespace: DevExpress.Xpf.Bars
Assembly: DevExpress.Xpf.Core.v18.2.dll
Declaration
Property Value
Type | Description |
---|---|
DevExpress.Xpf.Bars.ReadOnlyLinkCollection | A ReadOnlyLinkCollection that contains links to the current item. |
Remarks
It’s possible to create multiple links for a bar item. The Links collection allows you to access these links.
Example
This example shows how to get and focus an editor embedded into a bar.In the example bars are added to BarContainers that are automatically created by setting the BarManager.CreateStandardLayout property to True.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-get-and-focus-an-in-place-editor-e1557.
<!--Set CreateStandardLayout to True to create four BarContainers
at the top, left, right, and bottom edges-->
<dxb:BarManager CreateStandardLayout="True" Margin="12" Name="barManager1">
<dxb:BarManager.Items>
<dxb:BarButtonItem x:Name="btn" Content="button" ItemClick="btn_ItemClick" />
<dxb:BarEditItem x:Name="beiEditor" EditValue="text">
<dxb:BarEditItem.EditSettings>
<dxe:TextEditSettings></dxe:TextEditSettings>
</dxb:BarEditItem.EditSettings>
</dxb:BarEditItem>
</dxb:BarManager.Items>
<dxb:BarManager.Bars>
<dxb:Bar x:Name="topBar" Caption="Top Bar">
<!--Display the bar within the top BarContainer-->
<dxb:Bar.DockInfo>
<dxb:BarDockInfo ContainerType="Top" />
</dxb:Bar.DockInfo>
<dxb:Bar.ItemLinks>
<dxb:BarButtonItemLink BarItemName="btn" />
<dxb:BarEditItemLink BarItemName="beiEditor" />
</dxb:Bar.ItemLinks>
</dxb:Bar>
<dxb:Bar x:Name="leftBar" Caption="Left Bar">
<!--Display the bar within the left BarContainer-->
<dxb:Bar.DockInfo>
<dxb:BarDockInfo ContainerType="Left" />
</dxb:Bar.DockInfo>
<dxb:Bar.ItemLinks>
<dxb:BarButtonItemLink BarItemName="btn" />
</dxb:Bar.ItemLinks>
</dxb:Bar>
</dxb:BarManager.Bars>
<RichTextBox></RichTextBox>
</dxb:BarManager>
private void btn_ItemClick(object sender, DevExpress.Xpf.Bars.ItemClickEventArgs e) {
(beiEditor.Links[0] as BarEditItemLink).Editor.Focus();
}
See Also