Top Banner
‘Metro’ / Modern – ‘WinRT’ Also known as ‘Windows Store Apps’ --o-0-o-- Windows 8 comes as two parts Win32 and WinRT The Traditional Desktop is Win32 The new WinRT is ‘Metro’ or ‘Modern’ --o-0-o-- I will call it METRO http://www.winclickstartvulcan2.net/WebNotes/ClickStartMETRO/ClickStartMETRO.html
32

‘Metro’ / Modern – ‘WinRT’

Jan 07, 2016

Download

Documents

orrick

‘Metro’ / Modern – ‘WinRT’. Also known as ‘Windows Store Apps’ --o-0-o-- Windows 8 comes as two parts Win32 and WinRT The Traditional Desktop is Win32 The new WinRT is ‘Metro’ or ‘Modern’ --o-0-o-- I will call it METRO - PowerPoint PPT Presentation
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

Metro / Modern WinRT

Metro / Modern WinRTAlso known as Windows Store Apps--o-0-o--Windows 8 comes as two partsWin32 and WinRTThe Traditional Desktop is Win32The new WinRT is Metro or Modern--o-0-o--I will call it METROhttp://www.winclickstartvulcan2.net/WebNotes/ClickStartMETRO/ClickStartMETRO.html

The Surface TabletMicrosoft make and sell :- - a Surface RT which runs WinRT only - a Surface Pro which runs Win32 & WinRTSurface RT is designed for personal on-the-move use.

Surface Pro is for nerds like us we can use it to create and develop apps for Phone and Tablet.

The Pro model can be run as a powerful workstation running VS 2012, SQL Server, TFS, and with Hyper-V run virtual machines so the phone8 Emulator works.Windows 8 on a DesktopWe can use Win8 on our desktops to create apps for the WinRT Surface tablet, and test run them, without having a real Tablet device.

The Simulator is what is used by VS2012.The Simulator does not use a VM & Hyper-V

But app development for Phone8 does and the test platform is called the Emulator.The Simulator at work (a)

The Simulator at work (b)

a useful tool from Stardock

Simulator & Emulator

S or E from Visual Studio 2012

WinRT GUI and XAML mark-upWPF, WinRT and Phone8 all use the same UI technology, based on XAML script.

We can transfer 95% of learned skills and knowledge across all three Microsoft platforms.

Along with XAML comes data binding, and this too is consistent across the platforms.Licence - Creating AppsAs soon as we try to use VS to create apps for Tablet and Phone, we get a dialog to get a licence.

Restrictions File AccessThere is a Sandbox in both WinRT for Tablet as well as WP8 for Windows smartphone.Without the users consent, files can only be accessed from the local folder.

Local folders cant be seen from outside the app.

Other user files are available only through a file dialog tool.This is NOT as bad as it sounds !Local files folder structure

Local files - accessing

Manifest allowed user libraries

Restrictions Asynchronous operationsAny external operation has to be asynchronous.We as developers are NOT allowed to block the operation of the Tablet / Smartphone.C# code has await and async as well as Task in its keywords.

This is new to many, and takes a little getting used to BUT it is quite useable once we have a few good examples, to copy and adapt.

Task return typeOften we need to return something simple data, or a custom object. The Task with a type is the way to do this :-

Goodbye MessageBox !You will see stuff like this from time to time :-

[ I suggest just give it up no message boxes at all !? ]

Goodbye MessageBox (b)

Here is what Mr. Windows himself has to say :-(Charles Petzold, that is )Style of Apps Page drivenWe need to add our own page navigation app bar icons.Loss of data if controls not bound to project properties.

Fewer UI controls nicer new ones!

MVVM patterns Prism and lightBoth are available to Metro.

I prefer Prism as it is from Microsoft, and is not a one man band effort. This is my personal choice on how I approach things.

I got good results with Prism but read that the Light version from Laurent Bugnion (GalaSoft) works okay. I will try it out for my eNotes.MVVM more information

MVVM lots of choices Or nothing !Prism & Calculator trial app(a)

Prism & Calculator trial app(b)

Prism code bits and bobs

Touch is what its all about !Whether on Desktop, Tablet, or Phone its TOUCH !!! for Windows 8.Acer do a 23 ten point touch-screen.Ten point tracking is the Microsoft standard. Surface does 10 points.Other tablet oriented devices may be less, like 5.The events for WinRT UI elements no longer have click everywhere, and mouse.Checkout pointer, tap and press.[ Only a Button still has a click ]

Data using SQL, on TabletAs yet Microsoft have not provided us with SQL provision strangely!?Phone8 has L2S (LINQ to SQL) and it works fine.For the moment, I am using SQLite and it works fine enough, but lacks good LINQ support.I would expect something soon from M$, perhaps with MSSS 2014 ?--o-0-o--Since Entity Framework works with WP8 we can expect something soon for WinRT.--o-0-o--

The Thread PoolPlenty of Timer choices Dispatcher, as well as Delay and Periodic via the Thread Pool. { .. it is easy to use .. }Guidelines advise up to use the pool for tasks outside of the main UI thread.

Here is a set of six UserControls (UCs) which each use a timer from the pool.

All six are ticking away and refreshing the local times in the time zones indicated.

See ClickStartMETRO for more details on how to do this.the biggest drag Alwyn or Willie?

Metro dragging more fun !

FlipView ListView GridView : above are two ListView controlsLast, but yes LINQ !last but not leastLINQ to Objects works for Tablet and Phone8.If collections are in-memory then LINQ works.LINQ to SQL is not as yet available to WinRT.

SQLite is available to Metro, but it has some limited ability with LINQ through sqlite-net, a wrapper.

In my trial apps I use basic LINQ to retrieve a collection for a Table, and then LINQ to Objects, to do the rest.