Welcome to MSDN Blogs Sign in | Join | Help

Proof-of-concept Silverlight XPS reader gets some Beta 1 love [SimpleSilverlightXpsViewer updated for Silverlight 2 Beta 1!]

After a few customer requests to update my SimpleSilverlightXpsViewer proof-of-concept XPS reader for Silverlight 2 Beta 1, I finally found time to do so. :) I've just updated the original SimpleSilverlightXpsViewer demonstration page and also updated the original source code download - so you can try it out in your own browser and/or download the code to see how it works!

SimpleSilverlightXpsViewer Application

Click on the image above to play around with the application in your browser. More details about what it is doing and how it works are available in the original SimpleSilverlightXpsViewer post.

Notes:

  • This was a fairly straightforward port from the original 1.1 Alpha implementation to 2 Beta 1. I have not changed the manual Canvas-based layout to automatic layout via Grid/StackPanel/etc. - but I'd definitely take that approach if I were writing it from scratch today!
  • The XAML didn't change at all - and most of the necessary code changes are detailed in the Breaking Changes in Silverlight 2 document on MSDN.
  • Because of the file:// URL restrictions introduced a while ago as part of the 1.1 Refresh, the sample code includes a separate web site. I explain more in the second half of my post outlining changes for the 1.1 Refresh.
  • One notable improvement is that I was able to #define SETSOURCE (see the discussion in the original post) and therefore the images are all being accessed from the XPS document itself instead of needing to be pulled out as separate files! I removed the associated #if/#endif blocks because they are no longer relevant.
  • I still didn't see any way around the Glyphs.FontUri issue (discussed in the same section of the original post), so the fonts remain separate like before.
  • Silverlight occasionally renders the "pageGraphic" Rectangle incorrectly. The obvious consequence of this is that the white page background disappears if it extends outside the Silverlight control's edges (e.g., you've zoomed in or panned). It's possible to verify that you're in this situation because the black page border is also not drawn properly. I've found that a simple refresh of the web page typically corrects the problem.
Published Tuesday, April 08, 2008 3:04 PM by Delay
Filed under:

Comments

# WPF/Silverlight/Xaml Web Links - 2008/04/15

Tuesday, April 15, 2008 7:30 AM by Rob Relyea - Xamlified

Happy tax day for those of you in the US. A few queued up links of miscellaneous interest: Designer/Devloper

# Proof-of-concept Silverlight XPS reader comes to Beta 2 [SimpleSilverlightXpsViewer sample updated for Silverlight 2 Beta 2!]

Friday, June 13, 2008 3:37 AM by Delay's Blog

Earlier this week I was asked about an update to my SimpleSilverlightXpsViewer sample for the newly released

# Roadblock in the way of migrating the proof-of-concept Silverlight XPS reader [SimpleSilverlightXpsViewer sample does not work on Silverlight 2 RTW]

Saturday, October 18, 2008 3:07 AM by Delay's Blog

Since the public release of Microsoft Silverlight 2 , I've gotten a few internal and external requests

# re: Proof-of-concept Silverlight XPS reader gets some Beta 1 love [SimpleSilverlightXpsViewer updated for Silverlight 2 Beta 1!]

Monday, November 17, 2008 2:08 PM by Nordes

It would be good to see it working on the latest version of Silverlight.

Nordes

# re: Proof-of-concept Silverlight XPS reader gets some Beta 1 love [SimpleSilverlightXpsViewer updated for Silverlight 2 Beta 1!]

Monday, November 17, 2008 2:17 PM by Delay

Nordes,

Please see the trackback immediately before your comment titled "Roadblock in the way ..." - it's a link to a post I made explaining why the XPS reader doesn't work on Silverlight 2 RTW bits.

Thanks!

Anonymous comments are disabled
 
Page view tracker