Silverlight Menu Control: Popup Menu

Total Page:16

File Type:pdf, Size:1020Kb

Silverlight Menu Control: Popup Menu

Silverlight Menu Control: Popup Menu

We continue exploring the AgMenu Suite, our Menu Library for Silverlight, and in this video we’ll look at how to use the popup menu.

1. I have created a simple Silverlight application and I have added the reference to the AgMenu assembly.

2. And I have added a namespace alias dxm. To reference my AgMenu classes in my “xaml” file.

3. Let’s drop a simple TextBlock and align it to top.

4. We’ll call it “previewLabel”.

5. Then, we’ll drop an AgPopupMenu and call it “optionsMenu”

6. The popup will contain two simple menu items with IsCheckable and IsRadioItem set to true.

7. And when clicked on, they’ll simply change the font color of our text block.

8. We’ll invoke the popup menu from the MouseLeftButtonUp event.

9. By simply calling the optionsMenu.Popup 10. We’ll pass in the owner element which is our previewLabel

11. And we’ll pass in the coordinates where we want the popup to appear. We’ll use a couple of extension methods available in AgCore.

12. And that’s it. Let’s run it and see it in action

Thanks for watching and thank you for choosing DevExpress.

Recommended publications