1 / 41

The lifetime of XAML text: from input to display through printing

APP-914T. The lifetime of XAML text: from input to display through printing. Chipalo Street Program Manager Microsoft Corporation. Agenda. Overview of new features in XAML text controls Printing simplification in Windows 8 and XAML framework. You’ll leave with examples of how to

mele
Download Presentation

The lifetime of XAML text: from input to display through printing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. APP-914T The lifetime of XAML text: from input to display through printing Chipalo Street Program Manager Microsoft Corporation

  2. Agenda • Overview of new features in XAML text controls • Printing simplification in Windows 8 and XAML framework • You’ll leave with examples ofhow to • Use new features available in XAML text controls • Integrate a XAML app with the printing charm

  3. Familiar XAML text controls Editable • TextBox • PasswordBox Non editable • TextBlock

  4. What’s new Touch text selection • includes context menus • selection on by default for all controls except TextBlock Soft keyboard integration • implicit invocation

  5. What’s new IsSpellCheckEnabled • language specific for free • off by default on TextBox IsTextPredictionEnabled • language specific for free • only when using soft keyboard

  6. What’s new Clear text button Standard leading model • LineStackingStrategy = “BaselineToBaseline”

  7. What’s new Password reveal button • only reveals during hold

  8. demo Designed for touch Great touch features are baked into default text controls Touch text selection Integration with the soft keyboard Spell checking Text prediction

  9. RichTextBlock – new element • Richer text display than TextBlock • Designed for touch selection • Many of the same properties as TextBlock

  10. RichTextBlockOverflow – new element XAML page RichTextBlock Today, at the D9 Conference, we demonstrated the next generation of Windows, internally code-named “Windows 8,” for the first time. Windows 8 is a reimagining of Windows, from the chip to the interface. A Windows 8-based PC is really a new kind of device, one that scales from touch-only small screens through to large screens, with or without a keyboard and mouse. The demo showed some of the ways we’ve reimagined the interface for a new generation of touch-centric hardware. Fast, fluid and dynamic, the experience … RichTextBlockOverflow interface for a new generation of touch-centric hardware. Fast, fluid and dynamic, the experience … OverflowContentTarget

  11. RichTextBlock RichTextBlockOverflow RichTextBlockOverflow

  12. Linked text containers • RichTextBlock starts a chain of linked text containers • RichTextBlockOverflow elements can be linked to the first RichTextBlock or another RichTextBlockOverflow element (with no limit) • Linked text containers need to be in the visual tree for layout RichTextBlock RichTextBlockOverflow RichTextBlockOverflow RichTextBlockOverflow …

  13. RichTextBlockOverflow - attributes • Most controlled by RichTextBlock • OverflowContentTarget (also on RichTextBlock) • HasOverflowContent(also on RichTextBlock)

  14. demo Differentiating your experience Linked text containers allow for creation of unique and engaging experiences while maintaining the Windows 8 touch experience

  15. XAML printing Register for printing When: app startup Why: enable print charm by telling Windows your app can print

  16. XAML printing Register for printing Printing initialization When: user invokes print charm Why: provide Windows with basic info about current print job

  17. XAML printing Register for printing Printing initialization Paginate content When: printer settings are ready for preview pages to be created Why: ensure there are preview pages to show the user

  18. XAML printing Register for printing Printing initialization Paginate content When: Windows asks for a specific preview page Why: user has requested to see a print preview page Provide preview page

  19. XAML printing Register for printing Printing initialization Paginate content When: Windows asks app to create preview pages Why: user changed print settings Provide preview page

  20. XAML printing Register for printing Printing initialization Paginate content When: Windows is ready to print Why: user requested printing to begin Provide final pages Provide preview page

  21. XAML printing Register for printing Printing initialization Paginate content Provide final pages Provide preview page

  22. Register for printing PrintManagerprintManager = PrintManager.GetForCurrentView(); • publicMainPage() • { • } // add a handler for printing initialization printManager.PrintTaskInitializing+= newTypedEventHandler<PrintManager, PrintTaskInitializingEventArgs>(InitializePrintTask); // let XAML help with printing _printDocument= newPrintDocument(); // add handler to create print preview pages _printDocument.Paginate += newPaginateEventHandler(CreatePreviewPages); // add a handler to provide a specific preview page _printDocument.GetPreviewPage += new GetPreviewPageEventHandler(GetPreviewPage); // add a handler to provide final print pages _printDocument.AddPages += newAddPagesEventHandler(AddPages); _docSource= _printDocument.DocumentSource; // save the DocumentSource

  23. XAML printing Register for printing Printing initialization Paginate content Provide final pages Provide preview page

  24. Printing initialization • voidInitializePrintTask(PrintManagersender, • PrintTaskInitializingEventArgsargs) • { • } // provide the doc source and print job name args.Request.InitializePrintTask(documentSource, "Printing Demo"); // do any printing initialization needed. for example, create a // cache for print preview pages. _printPreviewPages = newList<UIElement>();

  25. XAML printing Register for printing Printing initialization Paginate content Provide final pages Provide preview page

  26. Paginate content // create print preview pages how ever you see fit // while(!CreatedAllPreviewPages()) //{ // _printPreviewPages.Add(CreateOnePage()) ; //} • privatevoidCreatePreviewPages(objectsender, PaginateEventArgs e) • { • } // tell Windows how many print preview pages there are _printDocument.SetPreviewPageCount(_printPreviewPages.Count)

  27. XAML printing Register for printing Printing initialization Paginate content Provide final pages Provide preview page

  28. Provide preview page // give Windows the preview page that it requested _printDocument.SetPreviewPage(e.PageNumber, _printPreviewPages[e.PageNumber- 1]); • private void GetPreviewPage(object sender,GetPreviewPageEventArgse) • { • }

  29. XAML printing Register for printing Printing initialization Paginate content Provide final pages Provide preview page

  30. Create final print pages • // send the pages to Windows in order • for(int i = 0; i < _printPreviewPages.Count; i++) • { • _printDocument.AddPage(_printPreviewPages[i]) ; • } • private void AddPages(object sender,AddPagesEventArgse) • { • } • // tell Windows you are done giving it pages to print • _printDocument.AddPagesComplete();

  31. demo From digital to physical Use the devices charm to print a Metro style app built with the XAML framework

  32. A lot of great features have been added to the XAML text stack.

  33. All text controls have been improved to make touch a first class experience for developers and end users.

  34. Printing your app through the unified Windows 8 printing experience is simple.

  35. Related sessions • [PLAT-679T] Building Metro style apps that print • [APP-211T] Create Metro style apps quickly with built-in controls • [APP-737T] Metro style apps using XAML: what you need to know • [APP-515] Tips and tricks for developing Metro style apps using XAML

  36. For more information • Metro style app sample page http://go.microsoft.com/fwlink/?LinkId=221708 • Windows 8 blog http://blogs.msdn.com/b/b8/

  37. thank you Feedback and questions http://forums.dev.windows.com Session feedbackhttp://bldw.in/SessionFeedback

  38. © 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

More Related