Metro Nuggets

Bitesized tidbits for building Modern (Metro) apps.

PhoneFlipMenu Control for Windows Phone [UPDATED]

UPDATE: This control is now part of the coding4fun toolkit for Windows Phone. It’s usage is the same, but it’s been renamed to the AppBarPrompt. Any future updates will done to that, and not this version. Sample usage of the new prompt can be seen here.

The Windows Phone Mail app has, when you’re in an email, a respond button which when tapped, brings up three further options, as illustrated below:
Screen Capture (3) Screen Capture (2)

On the left we have the icons on the application bar, tap the respond button (on the left) and you get the options as shown in the picture on the right.

There is, however, no way of doing that in your own apps, so I created this control that does it.

The Solution

Using this control is actually very straight forward, in your page (or ViewModel), add the required using statement:

using ScottIsAFool.WindowsPhone.Tools;

Then in your application bar button’s click event (again, or a ViewModel command) just put something like this:

private void ApplicationBarIconButton_Click(object sender, EventArgs e)
{
    new PhoneFlipMenu(new PhoneFlipMenuAction("reply", () =>
                            {
                                MessageBox.Show("Hello");
                            }),
                        new PhoneFlipMenuAction("reply all", () => { }),
                        new PhoneFlipMenuAction("forward", () => { })).Show();
}

Each entry to be added comes in the form of a PhoneFlipMenuAction and that requires a text string and an Action, as can be seen in the above code.

Back Button

For marketplace certification, any dialog box or context menu that is displayed to the user should be able to be cleared by pressing the back button on the phone. PhoneFlipMenu supports this 100%.

Themes

What about themes I hear you say. PhoneFlipMenu is fully compatible with whatever theme you have, even if it’s custom. If your Applicationbar is Brown, so will PhoneFlipMenu. Using the defaults and on a Light theme? Not a problem, PhoneFlipMenu will look exactly the same as the Mail App.

Download

So where can you download this? Well, you can either download it from codeplex (yup, it’s open source), or the much better way of using nuget:
image5

Source

I mentioned it’s open source right? Yeah, so go take a gander if you like, it’s at http://phoneflipmenu.codeplex.com/

SL

Advertisements

5 responses to “PhoneFlipMenu Control for Windows Phone [UPDATED]

  1. Pingback: PhoneFlipMenu Control for Windows Phone

  2. S0m0ne March 21, 2012 at 21:15

    Nice, thanks alot!

  3. Jason April 6, 2012 at 21:56

    Very cool, but it needs to handle the ad control better as it hides behind the ad control when shown. Of course you can work around that, but it would be better if the control handled that automatically.

  4. scottisafool April 6, 2012 at 22:02

    @jason thanks for the feedback on that, will take a look and see what I can do.

  5. Pingback: Launching a Context Menu From Code | Metro Nuggets

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: