Tips and tricks for developing Metro style apps using XAML

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Preface Demo A Quick Thank You How Did We Do It?
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Building Scalable Web Apps with Windows Azure Name Title Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Interactivity Navigating a data model Working with large quantities of data Entry Editing and adding data User feedback and validation Presentation.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Announcing Demo Announcing.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

IoCompleteRequest (Irp);... p = NULL; …f(p);
DoRon Motter Development Lead Microsoft Corporation
Building world-ready Metro style apps with XAML
6/10/ :23 PM TOOL-504T A deep dive into Visual Studio 11 Express for designing Metro style apps using XAML Joanna Mason & Unni Ravindranathan Program.
Build data-driven collection and list apps using XAML
Power your app with Live services
Возможности Excel 2010, о которых следует знать
Debugging your Metro style apps using HTML
Title of Presentation 11/22/2018 3:34 PM
Metro style apps using XAML: Make your app shine
Deep dive on app data roaming
Baseline: How Are We Doing Now?
Title of Presentation 12/2/2018 3:48 PM
Build polished collection and list apps in HTML5
Customizing WPA Trace Views
Windows Phone application performance and optimization
File type associations and AutoPlay
Introduction to the new WPA user interface
Create rich, data-driven Web apps with ASP.NET 4.5 Web Forms
Silverlight Debugging
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows 8 Security Internals
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
Leveraging existing code in Metro style apps
Jason Zander Unplugged
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
Inside the Windows 8 driver developer workflow
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Bringing existing managed code into Metro style apps
WCL425 App Compat for Nerds Chris Jackson.
Presentation transcript:

Tips and tricks for developing Metro style apps using XAML TOOL-515T Tips and tricks for developing Metro style apps using XAML Tim Heuer 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.

Agenda Whirlwind tour of some tips and tricks we’ve learned/used from our app building so far in the XAML team You’ll leave with examples of how to Use XAML/code tips to make you productive

This is NOT a substitute for new XAML/Windows 8 Sessions.

Tips for Windows XAML Frame Rate Counter Exception Handling Async/await/Dispatcher BaseUri AppBar Buttons Localize XAML Content Binding HTML Content to WebView Create a Settings Panel BitmapImage.DecodePixel OAuth made easy for client apps

Tip: Enabling Framerate Counter What Turn on framerate counter for debugging data UI CPU Time (MS) Composition CPU Time (MS) Batch Count Memory Utilization UI Thread Framerate Composition Thread Framerate

EnableFramerateCounter 32-bit [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Xaml] "EnableFrameRateCounter"=dword:00000001 64-bit [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Xaml]

demo XAML tips & tricks

Tips for Windows XAML Frame Rate Counter Exception Handling Async/await/Dispatcher BaseUri AppBar Buttons Localize XAML Content Binding HTML Content to WebView Create a Settings Panel BitmapImage.DecodePixel OAuth made easy for client apps

Related sessions [APP-737T] Metro style apps using XAML: what you need to know [APP-741T] Metro style apps using XAML: Make your app shine [APP-494T] Stand out with styling and animation in your XAML app [APP-517T] Build polished collection and list apps using XAML [APP-503T] Make great touch apps using XAML

Further reading and documentation Windows Developer Center http://go.microsoft.com/fwlink/?LinkID=227201 Windows SDK Samples http://go.microsoft.com/fwlink/?LinkId=221708 Contact info – xamlfeedback@microsoft.com

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

11/21/2018 5:02 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.

Tip details

Tip: Turn On Exception Helpers How Debug | Exceptions Enable Native Exceptions (check them all) This must be done per-project Tools | Options | Debugging Uncheck “Enable Just My Code” UnhandledException debugger break

Tip: UnhandledException debugger break public App() { InitializeComponent(); UnhandledException += new UnhandledExceptionEventHandler(App_UnhandledException); } void App_UnhandledException(object sender, UnhandledExceptionEventArgs e) if (Debugger.IsAttached) string _errorMessage = e.Message; Debugger.Break();

Tip: Dispatcher/Async What Pay attention to awaitable tooltip helper this.Dispatcher.Invoke() when needed See [810] C# and VB in “Visual Studio 11”

Tip: BaseUri BitmapImage bmp = new BitmapImage(); // use BaseUri to get the absolute URI for the // asset within the Package // results in ms-resource://[PackageName]/Files/[RelativeUri] Uri imageUri = new Uri(this.BaseUri, "Images/Logo.png"); bmp.UriSource = imageUri; Image img = new Image(); img.Source = bmp;

Tip: Segoe UI Symbol for ApplicationBar icons <TextBlock Text="" FontFamily="Segoe UI Symbol" FontSize="26.667" /> 

Tip: localize XAML content <Grid x:Name="LayoutRoot" Background="#FF0C0C0C"> <TextBlock x:Uid="MyTextBlock" FontSize="72" /> </Grid>

Tip: binding HTML to WebView (helper) public static class WebViewHelper { const string style = "<style type=\"text/css\">body {{ background-color: black; color: white; font-family: Segoe UI Light; font-size: 18px; }}</style>{0}"; public static readonly DependencyProperty HtmlProperty = DependencyProperty.RegisterAttached("Html", "String", typeof(WebViewHelper).FullName, new PropertyMetadata("", OnHtmlChanged)); public static string GetHtml(DependencyObject depObj) return (string)depObj.GetValue(HtmlProperty); } public static void SetHtml(DependencyObject depObj, string value) depObj.SetValue(HtmlProperty, value); private static void OnHtmlChanged(DependencyObject debObj, DependencyPropertyChangedEventArgs args) var wv = debObj as WebView; if (wv == null) return; var html = args.NewValue.ToString(); wv.NavigateToString(string.Format(style, html));

Tip: binding HTML to WebView (usage) <WebView x:Name="WebContent" Width="800" local:WebViewHelper.Html="{Binding Content}" />

Tip: BitmapImage.DecodePixelWidth[Height] // set the decode width/height // this benefit shows in memory and not in UI BitmapImage bitmapImage = new BitmapImage(); bitmapImage.DecodePixelHeight = decodePixelHeight; bitmapImage.DecodePixelWidth = decodePixelWidth; bitmapImage.SetSource(fileStream);

Tip: custom settings panel What Use a UserControl for your settings UI Use transitions (RepositionTransition) for Animation Library behavior Catch user interaction on root layout for light dismiss implementation

Tip: OAuth made easy private async void Login (object sender, RoutedEventArgs e) { WebAuthenticationResult res = await WebAuthenticationBroker.AuthenticateAsync( WebAuthenticationOptions.Default, requestUri, callbackUri); PasswordCredential cred = new PasswordCredential("ServiceName", "Service", res.ResponseData.ParseToken("access_token")); PasswordVault pv = new PasswordVault(); pv.Add(cred); }