One app to rule them all Zero to hero with the Universal Windows - - PowerPoint PPT Presentation

one app to rule them all
SMART_READER_LITE
LIVE PREVIEW

One app to rule them all Zero to hero with the Universal Windows - - PowerPoint PPT Presentation

One app to rule them all Zero to hero with the Universal Windows Platform development Bluefragments blendrocks Daniel Vistisen Deani Hansen Senior consultant Developer & UI designer Daniel Deani Senior developer at Windows app


slide-1
SLIDE 1

One app to rule them all

Zero to hero with the Universal Windows Platform development

Daniel Vistisen Senior consultant Bluefragments Deani Hansen Developer & UI designer blendrocks

slide-2
SLIDE 2

Daniel

Senior developer at Bluefragments. Architect & developer

Deani

Windows app engineer at Slack. UI designer and developer

slide-3
SLIDE 3

One hour from m now.. ..

Fundamentals of the Universal Windows Platform Responsive UI

<RelativePanel /> <VisualStates /> <Triggers />

Continuum and different target devices Q/A

slide-4
SLIDE 4

Demo app

IoT Phone Desktop 4K video

720p video Image

slide-5
SLIDE 5

Phone Small Tablet 2-in-1s (Tablet or Laptop) Desktops & All-in-Ones Phablet Large Tablet Classic Laptop Xbox IoT Surface Hub Holographic

Windows 10

slide-6
SLIDE 6
slide-7
SLIDE 7

Window dows s device ce famil ilies

slide-8
SLIDE 8

Univers rsal App != Univers rsal App

Window

  • ws

s 8.1 Window

  • ws

s 10

Full Screen Portable Class Libraries (PCL) Windows Runtime (WinRT) One binary per target Intermediate Language Resizable Windows XAML + PCL Core API + WinRT One Binary Overall .NET Native

slide-9
SLIDE 9
slide-10
SLIDE 10

Re Relat ative ive resoluti utions ns

slide-11
SLIDE 11

Re Relat ative ive Panel

A new XAML layout control, which arranges its children by declaring relationships between them.

<RelativePanel> … </RelativePanel>

slide-12
SLIDE 12

https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.relativepanel

Re Relat ative ivePane anel, , on MSDN

https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.controls.relativepanel

slide-13
SLIDE 13

Layout and <RelativePanel />

DEMO

4K video

slide-14
SLIDE 14
slide-15
SLIDE 15

Visual al states s based d on WindowS

  • wSiz

ize – Pre UWP

public MainPage() { this.InitializeComponent(); this.SizeChanged += (s, e) => { var state = “Default"; if (e.NewSize.Width > 500) state = “Narrow"; else if (e.NewSize.Width > 750) state = “Normal"; else if (e.NewSize.Width > 1000) state = “Full"; VisualStateManager.GoToState(this, state, true); }; }

slide-16
SLIDE 16

Visual al states s with adaptive ptive triggers s (UWP) WP)

<VisualState x:Name="VisualState500min"> <VisualState.StateTriggers> <AdaptiveTrigger MinWindowWidth=“720" /> </VisualState.StateTriggers> </VisualState> MinWindowHeight (Minimum height for state) MinWindowWidth (Minimum width for state)

slide-17
SLIDE 17

Responsive UI with <VisualState />

DEMO

4K video

720p video

slide-18
SLIDE 18

Window dows s 10 on Raspb pberry y Pi 2 Model l B

Low cost (less than 300 DKK) HDMI Video Out1 GB memory & A7 900 Mhz (ARM) running Windows10 Runs Windows 10 ! Low hardware specs Limited resources Can only run one app at a time

Don’t do this at home HD video Lots of pictures Huge lists without item virtualization

slide-19
SLIDE 19

Device ce family ly specif ific ic code

bool isHardwareButtonsAPIPresent = Windows.Foundation.Metadata.ApiInformation .IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"); Windows.UI.Core.SystemNavigationManager.GetForCurrentView().BackRequested += TestView_BackRequested; var qualifiers = ResourceContext.GetForCurrentView().QualifierValues; string currentDeviceFamily; qualifiers.TryGetValue("DeviceFamily", out currentDeviceFamily); // currentDeviceFamily == ”IoT”

slide-20
SLIDE 20

Device ce family ly specif ific ic VisualS alStat ate trigger er

By building a simple custom trigger we can get rid of the code behind check. More UI logic contained in XAML

slide-21
SLIDE 21

Custom trigger & Raspberry Pi

DEMO

4K video

720p video Image

slide-22
SLIDE 22

Projecti ction

  • n API & Continuu

inuum

slide-23
SLIDE 23

Very powerful for product companies - high enterprise value – you’re already there with adaptive UI

Continuu inuum

slide-24
SLIDE 24

Projecti ction

  • n Manag

ager r API

slide-25
SLIDE 25

private async void StartProjecting_Click(object sender, RoutedEventArgs e) { //Check whether there is already active connection to an external display if (ProjectionManager.DisPlayAvailable) { int thisViewId; thisViewId = ApplicationView.GetForCurrentView().Id; var thisDispatcher = Window.Current.Dispatcher; await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal,()=> { // Display the page in the view. Not visible until “StartProjectionAsync” called var rootFrame = new Frame(); rootFrame.Navigate(typeof(ProjectionViewPage), initData); Window.Current.Content = rootFrame; Window.Current.Activate(); }); // Show the view on a second display await ProjectionManager.StartProjectingAsync(rootPage.Id, thisViewId); } } private async void StopProjecting_Click(object sender, RoutedEventArgs e) { await ProjectionManager.StopProjectingAsync(rootPage.ProjectionViewPageControl.Id, thisViewId); }

Projecti ction

  • n Manag

ager r API

slide-26
SLIDE 26

Wr Wrapp pping ing up

UWP platform – one binary to rule them all feat. device families Responsive UI is king Bonus: One unified store for all apps with all device families Really really high reusability

slide-27
SLIDE 27

Daniel Vistisen @danielvistisen Deani Hansen @deanihansen