Silverlight Popup Dialog
This Silverlight only Popup Dialog 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 Dialog control you will need to add a reference to Liquid.Popup.dll in your project.
You need to login to Download the Popup Dialog example, If you do not have a login you can register for free!
How to Use the Popup Dialog Control
To use the Popup Dialog on your Silverlight page:
<UserControl x:Class="PopupDialog.Page"
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:liquidPopup="clr-namespace:Liquid;assembly=Liquid.Popup"
Width="600" Height="300">
<Grid>
<Button x:Name="showDialog" Canvas.Left="20" Canvas.Top="20" Content="Show Dialog" Width="100" Height="20" Click="ShowDialog_Clicked" />
<liquidPopup:Dialog x:Name="areYouSure" Width="200" Height="180" Title="Are you sure?" Closed="AreYouSure_Closed">
<TextBlock x:Name="messageText" TextWrapping="Wrap" Text="Your form will now be submitted, due to the high levels of interest in this position please allow Two weeks to process." />
</liquidPopup:Dialog>
</Grid>
</UserControl>
In your C# code behind file you can refer to the Dialog using areYouSure. In this example we create a simple popup dialog containing OK and Cancel buttons with some text, to show the dialog click the 'Show Dialog' button.
using System;
using System.Collections.Generic;
using System.Linq;
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;
using Liquid;
namespace PopupDialog
{
public partial class Page : UserControl
{
public Page()
{
InitializeComponent();
}
private void ShowDialog_Clicked(object sender, RoutedEventArgs e)
{
areYouSure.Show();
messageText.Text = "New message";
}
private void AreYouSure_Closed(object sender, EventArgs e)
{
if (areYouSure.Result == DialogButtons.OK)
{
// Do some code here for the okay button
}
}
}
}
Like the .NET modal dialogs, we make a call to the Show() method when we want to display the dialog. Notice how the other controls on the parent Canvas become disabled when the dialog is displayed, this ensures the user closes the dialog before they can continue with your Silverlight application.
Example Silverlight Popup Dialog 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!