Custom Message Box in Windows Phone 7

In this post, I am going tell about Custom Message Box(Tomers.Phone.Controls.NotificationBox) in WP7. First I want to say how I getting know this control. When I code for Message Box In Wp7. I saw few things.

We can set only two type of Message box buttons. Those are

1) MessageBox.Show(“This is just normal Message Box”, “Title”, MessageBoxButton.OK);

2) MessageBox.Show(“This is just normal Message Box”, “Title”, MessageBoxButton.OKCancel);

But, when I am try to cache the result of Message box, I can see Yes,  No and None options in that.

1) MessageBoxResult.Cancel

2) MessageBoxResult.No

3) MessageBoxResult.None

4) MessageBoxResult.OK

5) MessageBoxResult.Yes

For above 3 result we did not have option to set like this MessageBoxButton.YesNo or MessageBoxButton.YesNoNone (Yes, No and None). When I try to used Yes or No or None, it show a message like this “This Value is not currently used.”

Yes, No and None Buttons in Windows Phone 7So, I just start taking help of SEO (Google and Bing). That Time I found one nice control call Tomers.Phone.Controls.NotificationBox. Using this Control we can customize buttons of Message box, Of course it is not MessageBox. It is Custom control designed like Message box. This control control is design using Popup (System.Windows.Controls.Primitives.Popup).

In this custom message box we can also add Check box.

For example :- We are showing tips when user open application. But, user don’t like to see those tips window. That time we can provide one option for him with check box.

I found some small differences also between Message box and Notification Box. For better under standing please check with below image..

Custom Message Box in Windows Phone 7

This is really nice control, to get more details and coding examples, please go to this  URL  http://blogs.microsoft.co.il/blogs/tomershamam/archive/2010/10/19/windows-phone-7-custom-message-box.aspx

Enjoy while coding..!

Thanks,

Naga Harish.

3 thoughts on “Custom Message Box in Windows Phone 7

Leave a Reply