Advanced Technology Days 18. i 19. studenog 2015., Cinestar Arena Centar.

Slides:



Advertisements
Similar presentations
View-Based Application Development Lecture 1 1. Flows of Lecture 1 Before Lab Introduction to the Game to be developed in this workshop Comparison between.
Advertisements

SharePoint Forms All you ever wanted to know about forms but were afraid to ask.
ORGANIZING THE CONTENT Physical Structure
Multimedia and the World Wide Web HCI 201 Lecture Notes #5A.
Module 10 WPF 2-D Graphics, Multimedia, and Printing.
Lessons learned from developing a Windows 8 Metro application in C# Frode Nilsen Nilsen Labs Ticki.
Dinko Jakovljević Microsoft Student Partner | BambooLab
CPU - 15% to 30% Working Set - 25% to 45%
XP 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial 5.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
The Power of Tables They aren't just for sitting stuff on anymore...
Chapter 1 Understanding the Web Design Environment
Create a Web Site with Frames
XP Tutorial 5New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Designing a Web Site with Frames Using Frames to Display Multiple Web Pages Tutorial.
Software development. Chapter 5 – Data management.
Creating a MagicInfo Pro Screen Template
WPF For PowerBuilder Developers
Introduction to.Net and ASP.Net Course Introduction Build Your Own ASP.Net Website: Chapter 1 Microsoft ASP.Net Walkthrough: Creating a Basic Web Forms.
CS5103 Software Engineering Lecture 08 Android Development II.
READING, WRITING, BINDING, VALIDATING AND VISUALISING YOUR DATA Business value with Silverlight.
Introduction to Silverlight. Slide 2 What is Silverlight? It’s part of a Microsoft Web platform called Rich Internet Applications (RIA) There is a service.
XP 1 Tutorial 5 Using Frames in a Web Site. XP 2 Tutorial Objectives  Describe the uses of frames in a Web site  Lay out frames within a browser window.
XP Using Frames in a Web Site Ali Alfayly. XP Tutorial Objectives Create frames for a Web site Control the appearance and placement of frames Control.
© Ms. Masihi.  The Dreamweaver Welcome Screen first opens when you start Dreamweaver.  This screen gives you quick access to previously opened files,
CSS Positioning Creating Special Effects with CSS CS202 Working with Cascading Style Sheets (Chapter 4) CS202 1.
1 Intro XAML Attribute syntax & property syntax Panels Reusable resources Controls Data binding Steen Jensen, spring 2014.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
London April 2005 London April 2005 Creating Eyeblaster Ads The Rich Media Platform The Rich Media Platform Eyeblaster.
An Introduction to Silverlight Matt Harrington Developer Evangelist, Microsoft October 20, 2011.
Windows Presentation Foundation. Agenda Introduction Developing Applications WPF and WF interoperability Custom Controls Styles and Templates Data Binding.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
Page Layout with CSS Learning Web Design: Chapter 16.
Copyright 2012 Adobe Systems Incorporated. All rights reserved. ® Copyright 2010 Adobe Systems Incorporated. All rights reserved. ® Copyright 2012 Adobe.
Tutorial 8 Designing a Web Site with Frames. XP Objectives Explore the uses of frames in a Web site Create a frameset consisting of rows and columns of.
Session 1 SESSION 1 Working with Dreamweaver 8.0.
INTRODUCTION TO ANDROID. Slide 2 Application Components An Android application is made of up one or more of the following components Activities We will.
Basic WPF Controls Doncho Minkov Telerik School Academy schoolacademy.telerik.com Technical Trainer
LAYOUT CONTROLS. XAML Overview XAML : eXtensible Application Markup Language pronounced (ZAMEL) is a markup language used to design user interfaces XML-based.
Object Oriented Software Development 9. Creating Graphical User Interfaces.
Copyright © Terry Felke-Morris WEB DEVELOPMENT & DESIGN FOUNDATIONS WITH HTML5 7 TH EDITION Chapter 7 Key Concepts 1 Copyright © Terry Felke-Morris.
Embedded Software SKKU 14 1 Sungkyunkwan University Tizen v2.3 Application Profiling & Debugging.
Tutorial 8 Designing a Web Site with Frames. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Explore the uses of frames.
Svetlin Nakov Telerik Corporation
ControlTemplate and DataTemplate Doncho Minkov Telerik School Academy Technical Trainer
New for dependency properties register for property changes.
HelloWorld Create a window store App Part 3: Navigation, layout, and views Follow the tutorial :
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
XP New Perspectives on Macromedia Dreamweaver MX 2004 Tutorial 5 1 Adding Shared Site Elements.
Developing Windows 8 Style Application With HTML and JavaScript Lino Tadros | Falafel Software.
0 Developing for Windows 10 Tony Champion Champion DS.
CHAPTER 4 Fragments ActionBar Menus. Explore how to build applications that use an ActionBar and Fragments Understand the Fragment lifecycle Learn to.
Boxes. boxes- learning targets o I will be able to display buttons (boxes) o I will be able to organize boxes o I will be able to create an animation.
Data Binding, Binding Properties Doncho Minkov Telerik School Academy Technical Trainer
In Windows 8 Store Applications
Introducing the Windows Mobile development
5/2/2018 1:53 AM © Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS.
Basic Controls and Plugins
UWA Responsive design.
Adapting UI for Different Screens and Orientations
XAML User Interface Creation in C#
Introduction to Silverlight
03 | Building Windows Store Apps with XAML Part 3
IBM Kenexa BrassRing on Cloud Responsive Apply: Visual Branding Tool
WPF AKEEL AHMED.
.NET and .NET Core 7. XAML Pan Wuming 2017.
Windows Phone: Optimizing Application Performance
Bare Metal Development for the Universal Windows Platform
Lists and List Items in Windows Runtime Apps
Fast-Track UiPath Developer Module 2: Getting to Know UiPath Studio
Running C# in the browser
Presentation transcript:

Advanced Technology Days 18. i 19. studenog 2015., Cinestar Arena Centar

10 trikova za brže i bolje Windows 10 aplikacije Igor Ralić

Move to Windows 10

Lots of performance work done (XAML shell apps…) Performance optimizations Example: new compiled XAML format Performance features for XAML developers Example: stay tuned New APIs, one app, billion devices…

Notable performance gains CPU - 15% to 30% Memory - 25% to 45%

.NET Native Compiles IL binaries into native binaries Static linking, no JIT The best of both worlds: managed development with C++ performance Up to 60% improvement in startup Debug/Release configuration Test regularly Upload IL package Store and compiler “in the cloud” bring down the right one Microsoft.NETNative.Analyzer nuget

Move to Windows 10

Profile using the latest tools

Users hate bad performance Nearly every respondent (98%) stressed that performance matters.

Profiling Set goals and & continuously evaluate performance when debugging PerfTips Memory tool CPU graph Drill into the details Application Timeline tool

PerfTips Tooltips with performance information How long was the app running During the previous step Since the last breakpoint Find which sections of code need more investigation

Memory tool & CPU graph Available even after the debugging has stopped Spikes are interesting!

Application Timeline Identify performance issues due to Parsing, layout, rendering Other app code Monitor FPS throughput

Demo

Move to Windows 10 Profile using the latest tools

Virtualize lists

List virtualization Realize only the visible items +a small number of adjacent items Recycle already used elements Just apply new values Good thing: it’s on by default Bad thing: you can easily break it 

Breaking the virtualization Putting a ListView/GridView inside a ScrollViewer Be careful with pull-to-refresh implementations Putting a ListView/GridView inside Grid Row with Height Auto StackPanel Changing the ItemsPanel template ItemsStackPanel, ItemsWrapGrid StackPanel, WrapGrid, VariableSizedWrapGrid

Demo

Without virtualization: With virtualization:

Without virtualization: With virtualization:

Move to Windows 10 Profile using the latest tools Virtualize lists

Optimize data bindings

x:Bind Compiled data binding introduced in UWP Heavy lifting done at compile time Slow runtime reflection (booo) – no more Performance boost Binding to events, too! x:Bind is validated at compile time No more silly typos

Using compiled binding Replace {Binding …} with {x:Bind …} Context for x:Bind is Page or UserControl DataContext is ignored (object-based) Mode=OneTime – new default

Syntax <TextBox Text="{Binding Converter ConverterLanguage ConverterParameter ElementName FallbackValue Mode Path RelativeSource Source TargetNullValue UpdateSourceTrigger}" <TextBox Text="{x:Bind Converter ConverterLanguage ConverterParameter ElementName FallbackValue Mode Path RelativeSource Source TargetNullValue UpdateSourceTrigger}"

DataTemplates Need {x:DataType …} <Image x:Name="ProfileImage" Source="{x:Bind ProfileImage}" RelativePanel.AlignVerticalCenterWithPanel="True" Stretch="Uniform" MaxHeight="100"/> <TextBlock x:Name="Name" …………

Demo

How do I handle… RelativeSource = Self, ElementName = … Simply use the element name (page/UC is the context!) RelativeSource = TemplatedParent Not supported, use TemplateBinding Source/DataContext Use page properties/fields

When to use classic binding? Duck typing – same property name x:Bind option – use interface or base class Programmatic binding creation Can’t add/remove bindings at runtime Use in a Style x:Bind can’t be used in setters

Move to Windows 10 Profile using the latest tools Virtualize lists Optimize data bindings

Load templates in phases

Why phases? Fast scrolling – can’t realize all elements at once Placeholders show up It can get ugly! Defining phases allows Prioritizing the template items Showing at least some data to the user

x:Phase Used to specify the order of realization of elements

x:Phase

Demo

Move to Windows 10 Profile using the latest tools Virtualize lists Load templates in phases Optimize data bindings

Optimize images

Loading large images can be resource intensive DecodePixelWidth and DecodePixelHeight properties If you know the exact image size that you need

Right sized decoding XAML tries to find the best decoding size, unless you connect BitmapImage to the XAML tree after setting the content decode images using synchronous decoding (SetSource) hide image via setting Opacity to 0 or Visibility to Collapsed use a Stretch of None on the image control or brush … If web API allows it, ask for appropriate image dimensions.

Demo

Move to Windows 10 Profile using the latest tools Virtualize lists Defer loading Optimize data bindings Optimize images

Optimize media

MediaElement Full screen playback for most efficient media playback If possible, without other XAML elements IsFullWindow Delay setting the MediaElement source Choose a video format close to the resolution it will be displayed at Not always possible, but a good idea

MediaElement overlay Put other elements to the side of embedded video

Improve media scrubbing Bind slider to MediaElement.Position or update via timer Don’t do both Reasonable timer steps (> 250ms) Scale the slider step frequency with the video length Set the MediaElement.PlaybackRate property to 0 when the user drags the thumb of the slider. Use PointerPressed, PointerMoved, PointerReleased

Move to Windows 10 Profile using the latest tools Virtualize lists Load templates in phases Optimize images Optimize media Optimize data bindings

Optimize XAML

Load only what you need Don’t put all your resources in App.xaml. Don’t load heavy dictionaries to use only one resource.

Repeating resources Use a resource dictionary – XAML platform will cache it.

Minimize element count

Live Visual Tree

Demo

Minimize overdrawing DebugSettings.IsOverdrawHeatMapEnabled

Reduce layout structure Simplify the hierarchical structure of the UI elements Try to avoid nesting too many panels Less nested panels == performance gain (especially in repeaters) ListView, GridView ItemTemplates

Delay element instantiation x:DeferLoadStrategy attribute Defer things that are not viewable in the first frame Hint: look for elements with Visibility=Collapsed Be wary of deferring elements in a ListView scenario

x:DeferLoadStrategy What causes element to be realized? Call FindName with the element name Call GetTemplateChild with the element name Use a Setter or Storyboard targeting the deferred element in VS Target the deferred element in any Storyboard Use a binding that is targeting the deferred element

Demo

Ensure your text is on the fast path In Windows 10, text rendering is 50% faster DebugSettings.IsTextPerformanceVisualizationEnabled Things that can break the optimization: Setting inline text Some text Character space != 0 TextTrimming != None, CharacterEllipsis, or WordEllipsis IsTextSelectionEnabled = true …

Move to Windows 10 Profile using the latest tools Virtualize lists Load templates in phases Optimize images Optimize media Optimize data bindings Optimize XAML

Responsiv edesign

Adjust to various screen sizes Design for a few key widths/breakpoints 320, 720, and 1024 epx.

Responsive design techniques Reposition Resize Reflow Reveal Replace Re-architect

Adaptive (state) triggers Triggers declare when a state is applied Zero-code visual state switching Setters set discrete properties TriggerVisualStateSetters Minimal window width 600 Wide Set StackPanel orientation to horizontal

Adaptive (state) triggers

DEMO

Move to Windows 10 Profile using the latest tools Virtualize lists Load templates in phases Optimize images Optimize media Optimize data bindings Optimize XAML Responsiv e design

Embrace open source

Open source Great open source community GitHub Blogs MVPs Most of the WinRT libs still work

Some projects Facebook SDK Windows State Triggers Adaptive Trigger Library Groves Expander control for UWP

Some ‘old’ (but good) stuff MVVM Light WinRT XAML Toolkit Cimbalino Toolkit

DEMO

Move to Windows 10 Profile using the latest tools Virtualize lists Load templates in phases Optimize images Optimize media Optimize data bindings Optimize XAML Responsiv e design Embrace open source

?

Igor Ralić Thank you!