Olter
Olter

Reputation: 1139

Showing message without any buttons in Windows Phone

I would like to create an info message box in Windows Phone.

It should look like a single text message, that's shown on screen for X seconds, and I doesn't have any confirmation buttons as MessageBox.Show() does. It would be used to show user some messages about the app progress, like "file download started", or "preferences saved".

I've tried to create something like that, using Popup element, but it seems a bit different of what I want to make.

With the popup I can create something like that

canvas.MouseLeftButtonUp += new MouseButtonEventHandler(popupCloseEvent);

For example, which closes this popup when user taps it.

or something similar. (Maybe can implement a timer there to close it after a few secs)

Are there better ways to create such thing?

Upvotes: 1

Views: 396

Answers (2)

AndrewJE
AndrewJE

Reputation: 868

You could use the either the Message Dialog or Overlay controls in the Coding4Fun toolkit.

Found here: http://coding4fun.codeplex.com/

They are really simple and easy to use controls.

Upvotes: 1

Milan Aggarwal
Milan Aggarwal

Reputation: 5104

Try this

In Xaml:

    <Popup Tap="Popup_Tap"></Popup>

In code behind:

    private void Popup_Tap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        (sender as Popup).IsOpen = false;
    }

I hope it helps.

Upvotes: 0

Related Questions