Silverlight Popup MessageBox

This Silverlight only Popup MessageBox is easy to implement on your Silverlight driven website and is also customizable to provide a visual feel suitable for any site design.

To use the Popup MessageBox control you will need to add a reference to Liquid.Popup.dll in your project.

How to Use the Popup MessageBox Control

To use the Popup MessageBox on your Silverlight page:

<UserControl x:Class="MessageBox.Page"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:liquidPopup="clr-namespace:Liquid;assembly=Liquid.Popup"
    Width="400" Height="300">
    <Canvas x:Name="LayoutRoot" Background="White">
        <Button x:Name="messageboxButton" Canvas.Left="16" Canvas.Top="8" Width="250" Height="32" Content="MessageBox Dialog" Cursor="Hand" Click="MessageBox_ButtonClick" />
        <liquidPopup:MessageBox x:Name="messageBoxDialog" Canvas.Left="50" Canvas.Top="50" />
    </Canvas>
</UserControl>
 

In your C# code behind file you can refer to the MessageBox using messageBoxDialog. In this example we create a simple popup dialog containing a Close button with some text.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace MessageBox
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
        }
        private void MessageBox_ButtonClick(object sender, RoutedEventArgs e)
        {
            messageBoxDialog.ShowAsModal("This is a Liquid Controls message box, a simplified version of our Dialog control", "Error");
        }
    }
}
 

Example Silverlight Popup MessageBox Control:

Silverlight Popup MessageBox Control

Your Comments and Questions Answered

 You are not logged in. You need to login to post new messages, if you do not have a login you can register for free!

dan said:

Hi CelticPidge,

Its not possible in the current version, at the moment it is simple text. I will at at fixing this in the next version. Thanks!

04/21/2009 10:50
 
CelticPidge said:

Hi - I'm using the Popup Messagebox but can't figure out how to include a scrollbar in the dialog? Can you help?

03/31/2009 09:49
 
dan said:

Hi Craig,

There is a bug in the current version which prevents modal use in a Grid, however this is fixed in the next version. Thanks!

02/18/2009 04:18
 
Craig Shearer said:

Hi

I've been playing with your PopupMesageBox control. Is there any way to use it modally with a non-Canvas based layout? I have a Grid as my main page layout but for it to work modally it requires a Canvas. I've tried several tricks, but none have been 100% successful.

Thanks,

Craig

02/17/2009 11:59
 
dan said:

Hi Ed,

We have implemented a new feature in version 5.1.5, a property named StartPosition which is what your looking for. By default it will center the dialog within it’s parent. Thanks!

01/12/2009 10:06
 
edhalsim said:

Hi,

I'm learning Silverlight and your controls are awesome! One question (I hope it's not dumb): How can I make the message box open in the center of the Silverlight application? I tried using Horizontal/VerticalAlignment, but that didn't seem to work. Would I have to make it a fixed size and then do the math to center it?

Thanks.
- Ed.

12/31/2008 12:59
 
dan said:

Hi,

The Button content can be set using the YesButtonContent, NoButtonContent etc. For more customization possiblilites you may need to use the Dialog control instead which allows you to use the CreateButton() method. Hope this helps!

12/18/2008 03:16
 
chrisgausden said:

How do you configure the buttons on the MessageBox. There is a CreateButton method but I can't make it work. Thanks in advance.

12/18/2008 03:43

Silverlight 3

Latest News

  • Silverlight 2 Controls V5.2.1 Released
    Jul, 03 2009

    After several months since the last release we have implemented many fixes to the controls library. The Rich TextBox has been improved with Links...

  • Silverlight 3 BETA Controls Released
    Mar, 30 2009

    As Silverlight 3 BETA is available now to test we thought we would present the Liquid Controls library for Silverlight 3. This BETA...

Silverlight 2 Controls

  • Rich TextBox

    Create and edit rich content with this slick and expandable Rich TextBox...

  • TreeView

    This easy to use TreeView comes with drag and drop, sorting, searching and much more...

  • Context Menu

    You too can have cool popup context menus in your Silverlight applications...

  • Resizable Dialog

    Draggable and resizable popup dialogs are what serious Silverlight developers need...

  • Spell Checker

    Real-time spell checking in Silverlight? We did it first here...