-
Notifications
You must be signed in to change notification settings - Fork 0
/
Window1.xaml.vb
42 lines (37 loc) · 1.7 KB
/
Window1.xaml.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Imports System.Windows
Imports System.Windows.Controls
Imports DevExpress.Xpf.Bars
Imports DevExpress.Xpf.Docking
Namespace DockManager_MenuCustomization
''' <summary>
''' Interaction logic for Window1.xaml
''' </summary>
Public Partial Class Window1
Inherits Window
Public Sub New()
Me.InitializeComponent()
End Sub
'#Region "#1"
Private Sub dockManager1_ShowingMenu(ByVal sender As Object, ByVal e As Base.ShowingMenuEventArgs)
Dim menu As ItemContextMenu = TryCast(e.Menu, ItemContextMenu)
If menu Is Nothing Then Return
' Action 1 - Insert a new About button at the first position in the menu.
Dim actionAddAboutItem As BarButtonItem = New BarButtonItem()
' Specify the position for the button via the InsertBarItemLinkAction.ItemLinkIndex attached property.
BarItemLinkActionBase.SetItemLinkIndex(actionAddAboutItem, 0)
actionAddAboutItem.Content = "About..."
AddHandler actionAddAboutItem.ItemClick, New ItemClickEventHandler(AddressOf btnAbout_ItemClick)
' Action 2 - Insert a separator
Dim actionAddSeparator As InsertBarItemLinkAction = New InsertBarItemLinkAction()
actionAddSeparator.ItemLink = New BarItemLinkSeparator()
actionAddSeparator.ItemLinkIndex = 1
' Add the actions to the ActionList
e.ActionList.Add(actionAddAboutItem)
e.ActionList.Add(actionAddSeparator)
End Sub
Private Sub btnAbout_ItemClick(ByVal sender As Object, ByVal e As ItemClickEventArgs)
MessageBox.Show("About window")
End Sub
'#End Region ' #1
End Class
End Namespace