A simple piece of code for Creating a Dialog from Silverlight.
private void button1_Click(object sender, RoutedEventArgs e)
{
ChildWindow flotwin = new ChildWindow(); flotwin.Title = “Blue Window”;
System.Windows.Controls.Primitives.Popup popup = new System.Windows.Controls.Primitives.Popup();
flotwin.MouseLeftButtonDown += (a, x) =>
{
this.LayoutRoot.Children.Remove(popup);
this.LayoutRoot.Children.Add(popup);
popup.IsOpen = true;
};
StackPanel stackPanel = new StackPanel()
{
Height = 600,
Width = 800
};
WebBrowser browswer = new WebBrowser();
browswer.Width = 800;
browswer.Height = 600;
browswer.Navigate(new Uri(http://MyServer/));
stackPanel.Children.Add(browswer);
flotwin.Content = stackPanel;
flotwin.Closing += (ss, ee) =>
{
popup.IsOpen = false;
};
popup.Child = flotwin;
popup.IsOpen = true;
LayoutRoot.Children.Add(popup);
}
Special Thank to Usama Wahab Khan
http://usamawahabkhan.blogspot.com/2010/06/flotable-window-deom.html