Silverlight Popup Bubble

This Silverlight only Popup Bubble 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 Bubble control you will need to add a reference to Liquid.Popup.dll in your project.

How to Use the Popup Bubble Control

To use the Popup Bubble on your Silverlight page:

<UserControl x:Class="Bubble.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="showDialog" Canvas.Left="20" Canvas.Top="20" Content="Show Dialog" Width="100" Height="20" Click="Bubble_ButtonClick" />
        <liquidPopup:Bubble x:Name="bubblePopup" Canvas.Left="50" Canvas.Top="50" Width="300" Height="120" Lip="BottomLeft">
            <StackPanel>
                <TextBlock Width="300" TextWrapping="Wrap" Padding="10" Text="This is a Liquid bubble popup! It will close in 15 seconds or when you click the Close button!" />
                <Button Content="Close" Click="BubbleClose_Click" HorizontalAlignment="Right" Margin="10" />
            </StackPanel>
        </liquidPopup:Bubble>
    </Canvas>
</UserControl>
 

In your C# code behind file you can refer to the Bubble using bubblePopup. In this example we create a simple popup bubble containing a Close button with some text, to show the dialog click the 'Show Bubble' button.

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 Bubble
{
    public partial class Page : UserControl
    {
        public Page()
        {
            InitializeComponent();
            bubblePopup.IsTimerEnabled = true;
            bubblePopup.TimeUntilClose = new TimeSpan(0, 0, 15);
        }
        private void Bubble_ButtonClick(object sender, RoutedEventArgs e)
        {
            bubblePopup.Show();
        }
        private void BubbleClose_Click(object sender, RoutedEventArgs e)
        {
            bubblePopup.Close();
        }
    }
}
 

If you display the bubble without clicking the Close button, the bubble will close automatically after 15 seconds. This timeout and close feature is present on all the Liquid Popup dialogs.

Example Silverlight Popup Bubble Control:

Silverlight Popup Bubble 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!

sree said:

03/11/2009 05: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...