How to dynamicly add NavigationItems to NavigationBar and handle Click Event

Answered
0
0

Hey

I try to add dynamicly NavigationItems to a NavigationBar – This works fine.

When I add all items to the NaviagtionBar with some code like this:

For Each locNavigationItem In myModel.GetMenuItems
If locNavigationItem.Items.Count > 0 Then
For Each locItem In locNavigationItem.Items
locItem.Tag = locItem.Name
AddHandler locItem.Click, AddressOf NavigationItemClicked

Next
End If
Me.NavigationBar.Items.Add(locNavigationItem)
Next

 

The Click event is fired as expected. – But the problem is, that the sender of the click event isn’t a NavigationItem anymore, it got translated to a FlexLayoutPanel.
Within this FlexLayoutPanel, I can itereate through the controls, but none of them has the Tag set – Also the FlexLayoutPanel itself.

 

Could you please give me some advise, how I can handle this?

THX in advance

 

  • You must to post comments
Best Answer
0
0

Hi Harald,

please handle the ItemClicked event. There you will find clicked item in e.Item.

Best regards
Frank

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.