Answered by:
OOB open new browser window ?

Question
-
Can you open a new (full) browser window with HTML content (created in Silverlight) from an OOB Silverlight application ?
If so, how ?
Thanks
Etienne
Wednesday, November 16, 2011 4:41 AM
Answers
-
Yep. Take a look at this thread : http://social.msdn.microsoft.com/Forums/en-US/silverlightarchieve/thread/4f754c0a-5a6f-4d50-b5a2-e24657c3269e#92107b3d-304c-4639-823a-4584e2d91a09
Tony
Wednesday, November 16, 2011 5:22 AM -
The WebBrowser control has the OS's default browsers printing capabilities. I built a quick test case just to make sure. So if you right click the browser window you will the the standard context menu with printing being a part of that.
You can call javascript in the WebBrowser by using the InvokeScript method on the control. So you can create a print button in your app and fire off the print() method in javascript on the browser.
Hope this helps.
Wednesday, November 16, 2011 5:59 AM
All replies
-
Yep. Take a look at this thread : http://social.msdn.microsoft.com/Forums/en-US/silverlightarchieve/thread/4f754c0a-5a6f-4d50-b5a2-e24657c3269e#92107b3d-304c-4639-823a-4584e2d91a09
Tony
Wednesday, November 16, 2011 5:22 AM -
Thanks !, how about the html content created in silverlight (I don't want to use the web service and store html on the server), I guess I could use file://location_of_newly_created_html_page.html as url (creating a text file [html] using silverlight IO) ? Other ideas ?
Wednesday, November 16, 2011 5:35 AM -
In your particular case, does the WebBrowser control not work for you? It seems that would be the simpliest solution.
Wednesday, November 16, 2011 5:40 AM -
In your particular case, does the WebBrowser control not work for you? It seems that would be the simpliest solution.
Hi Tony, the reason I wanted to open a new full browser window was so that the end-user could print the content [we are shying away from Silverlight's printing abilities since it seems to be slow and create huge temporary files]. If I use the WebBrowser control then I would have to display the content in the OOB window and not have the browser's printing ability (?)
Wednesday, November 16, 2011 5:48 AM -
The WebBrowser control has the OS's default browsers printing capabilities. I built a quick test case just to make sure. So if you right click the browser window you will the the standard context menu with printing being a part of that.
You can call javascript in the WebBrowser by using the InvokeScript method on the control. So you can create a print button in your app and fire off the print() method in javascript on the browser.
Hope this helps.
Wednesday, November 16, 2011 5:59 AM -
Thanks Tony, the javascript print() method prints a blank page, but having the end-user right-click and print is a good enough option for us now.
Regards
Etienne
Wednesday, November 16, 2011 9:48 AM