-
Notifications
You must be signed in to change notification settings - Fork 0
/
HamburgerMenuItem.xaml.vb
54 lines (46 loc) · 1.43 KB
/
HamburgerMenuItem.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
43
44
45
46
47
48
49
50
51
52
53
54
<ComponentModel.DefaultEvent("Click")>
Public Class HamburgerMenuItem
Private _Icon As String = ""
Public Property Icon As String
Get
Return _Icon
End Get
Set(value As String)
_Icon = value
lblIcon.Content = value
InvalidateArrange()
End Set
End Property
Private _Caption As String = "Menu item"
Public Property Caption As String
Get
Return _Caption
End Get
Set(value As String)
_Caption = value
lblCaption.Content = value
InvalidateArrange()
End Set
End Property
Private _Selected As Boolean = False
Public Property Selected As Boolean
Get
Return _Selected
End Get
Set(value As Boolean)
_Selected = value
If value = True Then
lblSelected.Visibility = Visibility.Visible
Else
lblSelected.Visibility = Visibility.Collapsed
End If
End Set
End Property
Private Sub MenuItem_SizeChanged(sender As Object, e As SizeChangedEventArgs) Handles Me.SizeChanged
Height = 48
End Sub
Public Event Click(Sender As HamburgerMenuItem)
Private Sub Cmd_Click(sender As Object, e As RoutedEventArgs) Handles Cmd.Click
RaiseEvent Click(Me)
End Sub
End Class