Step 3 of 4: Adding Code

In the previous step, you customized the C1ContextMenu and add three menu items. In this step, we're going to add some code that returns the last item tapped so any user of the phone will be able to see the last menu item that was selected.

1.   In the Visual Studio menu, select View | Code.

2.   Add the following code:

private void C1ContextMenu_ItemTap(object sender, SourcedEventArgs e)

        {

            MenuFeedback.Text = ((C1MenuItem)e.Source).Header + " tapped !!";

        }

When the project runs and a menu item is tapped in the C1ContextMenu, the TextBlock named MenuFeedback will state the last menu item that was tapped.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.