views:

50

answers:

2

Hi

Can anyone send me the code for opening a XamWebDialogWindowon button click in silverlight. I am using a MVVM model and capturing button click in Controller

A: 

The control you talk about is from the Infragistics suite, there's a really good link here for the detailed explanation of how the control is used, but to answer your question

//From the View.cs
XamWebDialogWindow myDialogWindow = new XamWebDialogWindow();
this.LayoutRoot.Children.Add(dialogWindow);

This cannot be done in the ViewModel and should not, i like to set the DataSource of the popup window to the current ViewModel so i only need to deal with one DataSource once the popup occurs

XamWebDialogWindow myDialogWindow = new XamWebDialogWindow();
myDialogWindow.DataSource = this.Resources["DataSource"];
//Where "DataSource" is the x:Name of the DataSource on your parent xaml

If you really want to popup the window from your ViewModel, for whatever reason, there are ways, yes you can

Neil
A: 

I wanted to open the XamWebDialogWindow from the view page only. I have opened it now but the problem now is how to load another .xaml page in the XamWebDialogWindow

Kumar Kisley
This is a new question, accept an answer, otherwise no one is going to answer your comment
Neil