default.aspx
Silverlight .NET Controls and CMS
Home
controls.aspx
Silverlight Controls
Controls
Popup Bubble

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.

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:liquid="clr-namespace:Liquid;assembly=Liquid"
    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" />
        <liquid: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>
        </liquid: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!

Be the first to post a comment or question.

 
This page is 21.35KB and was generated by the SilverPages CMS in 0.109 seconds. Total impressions: 2908.