PedroC88
PedroC88

Reputation: 3829

Dialog for Options on Hold Listbox Item

I'm new to Windows Phone development and I don't know how to do what I'm trying to do or even if it's the most proper way to do it following WP7 Design Guide.

I have a short list of Items in a ListBox the user can select from, I want to give the user a set of options when they HOLD an item. I don't know if there's a way to show a little popup dialog with some radio buttons and two buttons (Cancel and OK) that could perform some actions right there or lead the user to another page where he can perform the desire action.

What is the best approach to do this?

Upvotes: 1

Views: 391

Answers (2)

Rowland Shaw
Rowland Shaw

Reputation: 38130

There is a context menu control in the Silverlight toolkit which may save having to write your own control to achieve this functionality

Upvotes: 1

nkchandra
nkchandra

Reputation: 5557

Create a directory with name "Views". You can create a UserControl in that directory by,

Select Add new item --> WindowsPhone UserControl from the available templates and name it "myusercontrol.xaml" for example.

To Add that usercontrol to your actual page as a control.

xmlns:views="clr-namespace:YourSolutionName.Views" //Add this at the beginning of your xaml page to <phone:PhoneApplicationPage/>

<views:myusercontrol x:Name="myUserControlView" Margin="40,300"  Visibility="Collapsed" />
//Add the above line before the ListBox

And finally, in your Hold eventhandler, you can do something like

myUserControlView.Visibility = Visibility.Visible;

You can customize your "myusercontrol.xaml" to fit your requirements like radiobuttons, cancel Ok buttons etc

May not be a best solution, but I Hope this helps

Upvotes: 1

Related Questions