Presentation is loading. Please wait.

Presentation is loading. Please wait.

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

Similar presentations


Presentation on theme: "The lifetime of XAML text: from input to display through printing"— Presentation transcript:

1 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 © 2010 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.

2 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 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 Soft keyboard integration
includes context menus selection on by default for all controls except TextBlock Soft keyboard integration implicit invocation

5 What’s new IsSpellCheckEnabled IsTextPredictionEnabled
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

13 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

14 RichTextBlockOverflow - attributes
Most controlled by RichTextBlock OverflowContentTarget (also on RichTextBlock) HasOverflowContent (also on RichTextBlock)

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

16

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

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

19 Printing initialization
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

20 Printing initialization
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

21 Printing initialization
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

22 Printing initialization
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

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

24 Register for printing public MainPage() { }
PrintManager printManager = PrintManager.GetForCurrentView(); // add a handler for printing initialization printManager.PrintTaskInitializing += new TypedEventHandler<PrintManager, PrintTaskInitializingEventArgs>(InitializePrintTask); // let XAML help with printing _printDocument = new PrintDocument(); // add handler to create print preview pages _printDocument.Paginate += new PaginateEventHandler(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 += new AddPagesEventHandler(AddPages); _docSource = _printDocument.DocumentSource; // save the DocumentSource

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

26 Printing initialization
void InitializePrintTask (PrintManager sender, PrintTaskInitializingEventArgs args) { } // 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 = new List<UIElement>();

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

28 Paginate content private void CreatePreviewPages(object sender, PaginateEventArgs e) { } // create print preview pages how ever you see fit // while(!CreatedAllPreviewPages()) //{ // _printPreviewPages.Add(CreateOnePage()) ; //} // tell Windows how many print preview pages there are _printDocument.SetPreviewPageCount(_printPreviewPages.Count)

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

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

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

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

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

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

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

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

37 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

38 For more information Metro style app sample page Windows 8 blog
Windows 8 blog

39 thank you Feedback and questions http://forums.dev.windows.com
Session feedback

40 12/9/2018 3:14 AM © 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. © 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.

41


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

Similar presentations


Ads by Google