Top Banner
Windows 10 UWP tips & tricks for developers. Darius Pauliukevičius
33

Windows 10 UWP tips and tricks for developers

Apr 15, 2017

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Windows 10 UWP tips and tricks for developers

Windows 10 UWP tips & tricks for developers.Darius Pauliukevičius

Page 2: Windows 10 UWP tips and tricks for developers

Use MVVM

Page 3: Windows 10 UWP tips and tricks for developers

Typical Parts of a full MVVM Solution

View ViewModel

Model

Services

VM Locator

Service Locator

TestsUITests

Commands

Binding

Method Invoke

Messaging

Events

Page 4: Windows 10 UWP tips and tricks for developers

A highly testable and well-architected application!

bonus!

Page 5: Windows 10 UWP tips and tricks for developers

Responsive Design

Page 6: Windows 10 UWP tips and tricks for developers
Page 7: Windows 10 UWP tips and tricks for developers

Breakpoints

Page 8: Windows 10 UWP tips and tricks for developers

Adaptive state triggers

Page 9: Windows 10 UWP tips and tricks for developers

Demo

Page 10: Windows 10 UWP tips and tricks for developers

Optimize XAML

Page 11: Windows 10 UWP tips and tricks for developers

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

resource.

Page 12: Windows 10 UWP tips and tricks for developers

Reduce layout structureMinimize element count

Page 13: Windows 10 UWP tips and tricks for developers

Minimize overdrawingDebugSettings.IsOverdrawHeatMapEnabled

Page 14: Windows 10 UWP tips and tricks for developers

Ensure your text is on the fast pathDebugSettings.IsTextPerformanceVisualizationEnabled

In Windows 10, text rendering is 50% faster

Page 15: Windows 10 UWP tips and tricks for developers

Delay element instantiationx:DeferLoadStrategy

Page 16: Windows 10 UWP tips and tricks for developers

Demo

Page 17: Windows 10 UWP tips and tricks for developers

Optimize images

Page 18: Windows 10 UWP tips and tricks for developers

Image rendering optimizationLet API return images with appropriate dimensions.or useDecodePixelWidth and DecodePixelHeight

Page 19: Windows 10 UWP tips and tricks for developers

Use Virtualization

Page 20: Windows 10 UWP tips and tricks for developers

List virtualizationRealize only visible items+a little bit more

Is on by defaultEasy to break it

Page 21: Windows 10 UWP tips and tricks for developers

Incremental list loadingImplement ISupportIncrementalLoading

Page 22: Windows 10 UWP tips and tricks for developers

Demo

Page 23: Windows 10 UWP tips and tricks for developers

Optimize data bindings

Page 24: Windows 10 UWP tips and tricks for developers

x:BindHeavy lifting done at compile timePerformance boostx:Bind is validated at compile time

Page 25: Windows 10 UWP tips and tricks for developers

Test RELEASE build

Page 26: Windows 10 UWP tips and tricks for developers

.NET NativeWindows 10 Release build compiles IL binaries into native binaries.Up to 60% improvement in startup.

Release build behavior might be different.

Page 27: Windows 10 UWP tips and tricks for developers

Use adaptive live tiles

Page 28: Windows 10 UWP tips and tricks for developers

Adaptive Live tileFull flexibility on how content is displayed on the Live Tile.

XML declaration

Notifications Visualizer (https://www.microsoft.com/en-us/store/apps/notifications-visualizer/9nblggh5xsl1)

Page 29: Windows 10 UWP tips and tricks for developers

Adaptive live tile from serverStartPeriodicUpdate or StartPeriodicUpdateBatch TileUpdateManager.CreateTileUpdaterForApplication()

Page 30: Windows 10 UWP tips and tricks for developers

Secure your API

Page 31: Windows 10 UWP tips and tricks for developers

Certificate validation chainAdd certificate to app and set exclusive trust.It will create new app certificate validation chain.

Page 32: Windows 10 UWP tips and tricks for developers

Useful librariesWinRT XAML Toolkit(https://github.com/xyzzer/WinRTXamlToolkit)

MyToolkit(https://github.com/MyToolkit/MyToolkit)

Template10(https://github.com/Windows-XAML/Template10)

Page 33: Windows 10 UWP tips and tricks for developers