Is that possible to have open dialog window inside child window in Silverlight?
I need to have OpenDialog window being inside browser window of Silverlight application. I am wondering if it possible. Any help is highly appreciated!
Below is the code I have to open child window and OpenDialog:
private void openChildWindow_Click(object sender, System.Windows.RoutedEventArgs e)
{
Add_ChildWindow ap = new Add_ChildWindow();
ap.Show();
OpenFileDialog openFileDialog1 = new OpenFileDialog();
// Set filter options and filter index.
开发者_如何学编程 openFileDialog1.Filter = "Packages (*.sprj)|*.sprj|Packages (*.sprj)|*.sprj";
openFileDialog1.FilterIndex = 1;
openFileDialog1.Multiselect = true;
// Call the ShowDialog method to show the dialog box.
bool? userClickedOK = openFileDialog1.ShowDialog();
// Process input if the user clicked OK.
if (userClickedOK == true)
{
// Open the selected file to read.
//textBox1.Text = openFileDialog1.File.Name;
System.IO.Stream fileStream = openFileDialog1.File.OpenRead();
using (System.IO.StreamReader reader = new System.IO.StreamReader(fileStream))
{
// Read the first line from the file and write it the textbox.
// tbResults.Text = reader.ReadLine();
}
fileStream.Close();
}
}
An Open Dialog window is a system window. Silverlight being sandboxed has to use the system open dialog I believe.
In other words, I don't think this is possible.
精彩评论