Click here to Skip to main content
15,891,184 members
Articles / Programming Languages / C#
Tip/Trick

Using Silverlight Message Boxes with Icons - Error, Info, Confirm, Text, and Combo Input

Rate me:
Please Sign up or sign in to vote.
4.83/5 (5 votes)
24 Feb 2011CPOL 25.3K   5   4
Tutorial of easy to use Silverlight message boxes hosted on CodePlex.
If you ever tried to make custom Silverlight message boxes that look cooler and more presentable than the default message box support that ships with Silverlight, you know what a hassle it is. Below I will give you a tutorial of how to use Simple but Cool Silverlight Message Boxes to add production quality message boxes to your Silverlight application.

Step-by-Step Instructions: How to Integrate with an Existing Project

Please follow the below steps to correctly utilize the Silverlight Message Boxes in your project:

  1. Download the .DLL library file from Releases.
  2. Once saved on a local computer, right click on the .DLL file and select properties. Here click on Unblock option.
  3. Now at your Silverlight project, right click on references and select Add Reference
  4. Go to the Browse tab, and locate the downloaded and unblocked .DLL file.
  5. Once the library file was successfully referenced in the project, put using SilverlightMessageBoxLibrary; statement on top of each class where the message boxes will be used.
  6. Follow the code samples at Example Code for further instructions.

//Info Message.
Message.InfoMessage("Hello! I am here to help you!");

//Error Message.
Message.ErrorMessage("Darn! Something went wrong.");

//Confirmation with handlers.
CustomMessage confirmMessage = new CustomMessage("Do you like me?", CustomMessage.MessageType.Confirm);

confirmMessage.OKButton.Click += (obj, args) =>
{
    Message.InfoMessage("Thanks. You make me blush.");
};

confirmMessage.Show();

For more example code, please see the code section for the control.

Example Screenshot:



License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralRe: True, true... Pin
DrABELL24-Feb-11 14:02
DrABELL24-Feb-11 14:02 
True, true...
GeneralconfirmMessage.OKButton.Click, the click event is not availa... Pin
vikas45645616-Dec-11 5:14
vikas45645616-Dec-11 5:14 
GeneralReason for my vote of 5 I like this Silverlight solution! Pin
DrABELL24-Feb-11 13:05
DrABELL24-Feb-11 13:05 
GeneralRe: Yes. If you look in the web, there are multiple tutorials on... Pin
Zorayr Khalapyan24-Feb-11 13:08
Zorayr Khalapyan24-Feb-11 13:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.