Skip to main content
Microsoft Silverlight
Home Forums Silverlight Programming Silverlight Controls and Silverlight Toolkit How to show XAML file as model dialog?
5 replies. Latest Post by Keith.Mahoney on July 15, 2008.
(0)
pmkr
Member
17 points
31 Posts
07-14-2008 2:44 AM |
Hi, I have 3 XAML files in my project. When I click on button I want to show XAML file as model dialog. How can I do that. Any help would be appreciated.
Thanks
mustafac...
36 points
39 Posts
07-14-2008 3:23 AM |
Hi;
{
07-14-2008 7:00 AM |
Hi Thanks for your reply. I couldn't understand this code. Could you please explain this?. What is this MySoftClass=projectName meaning. and there is not intellisense for assembly. How can I get this Assembly abject?
07-15-2008 10:20 AM |
you can get Assembly name Assembly assembly = Assembly.GetExecutingAssembly();
// Retrieve a list of resource names contained by the assembly. string[] resourceNames = assembly.GetManifestResourceNames(); foreach (string resourceName in resourceNames) { Console.WriteLine(resourceName); }
sladapter
All-Star
20775 points
3,818 Posts
07-15-2008 10:59 AM |
There is no Modal Dialog in Sivlerlight. But you can simulate one by putting your UserControl to a Canvas and make this Canvas on top of everything on your page. Between your top Canvas and the rest of the page you put a simi-transparent rectangle to mask the rest of the page. So no user input is accepted in the main page until you close your Top canvas (make it visibility=Collapsed).
Take a look at this Scott Gu's tutorial. It shows you how to display a detailed section data in a "Modal" box: http://weblogs.asp.net/scottgu/archive/2008/02/22/first-look-at-silverlight-2.aspx
If you want that box be able to be draggable, take a look that this code I put together. It's a resizable and draggble popup window you can put any content in it. You can also make it "Modal". You can download the code.
http://silverlight.net/forums/p/12467/41324.aspx#41324
Keith.Ma...
Participant
872 points
131 Posts
07-15-2008 5:32 PM |
Hi pmkr,I assume that the three xaml files are UserControls in your project?The easiest way to get modal-dialog-like behaviour is Silverlight is to place your UserControl into a PopUp control.The following links should be helpfulhttp://msdn.microsoft.com/en-us/library/system.windows.controls.primitives.popup(VS.95).aspxhttp://blogs.msdn.com/silverlight_sdk/archive/2008/04/18/playing-with-the-popup-control.aspx