locked
Printing in C# xaml windows 8 store RRS feed

Answers

  • Mike's blog looks about as simple as it gets. He demonstrates and explains the simple one-line-of-text scenario in the beginning. It's 120 lines of code, but that includes the entire MainPage code file including blank lines and comments.

    Can you explain which part of this is confusing you?

    It would be possible to wrap that into a class that takes the UIElement to print and registers for and handles the printing events (that's essentially what your minimal WPF code does), but that isn't available in-box.

    The real complexity comes in the second two thirds of the article where he starts adding in multiple pages, custom layout, etc.

    --Rob

    • Marked as answer by RandyPete Tuesday, September 24, 2013 4:57 AM
    Tuesday, September 24, 2013 3:04 AM
    Moderator

All replies

  • Mike's blog looks about as simple as it gets. He demonstrates and explains the simple one-line-of-text scenario in the beginning. It's 120 lines of code, but that includes the entire MainPage code file including blank lines and comments.

    Can you explain which part of this is confusing you?

    It would be possible to wrap that into a class that takes the UIElement to print and registers for and handles the printing events (that's essentially what your minimal WPF code does), but that isn't available in-box.

    The real complexity comes in the second two thirds of the article where he starts adding in multiple pages, custom layout, etc.

    --Rob

    • Marked as answer by RandyPete Tuesday, September 24, 2013 4:57 AM
    Tuesday, September 24, 2013 3:04 AM
    Moderator
  • Thank you for your help.  I've figured it out.

    By the way, I'm not the only one complaining about how hard it is to print with metro app.  Did MS make it this hard to make real MS developers feel like 1337s?  A search on the internet will show many many people complaining about how hard it is.  Even bloggers who have written tutorials have admitted that this is way too complicated.  Many people have simply given up.  This is why there are so few quality apps in the winstore.  For some reason, what used to be easy to do with wpf projects are now really big stumbling blocks. 

    Just this printing thing alone, I am developing a metro version parallel to a desktop version.  Over in the desktop version, it took 4 lines of code  to print out the results.  In the metro version, it takes 200 lines of code and 5 hours of work time.

    Added by edit.

    And even in Mike's blog, if you follow it you won't be able to print multiple pages of texts.  And the app crashes.  I had to modify his code and added in my own code to stabilize it. 

    • Edited by RandyPete Tuesday, September 24, 2013 7:12 AM
    Tuesday, September 24, 2013 3:50 AM