SlideShare a Scribd company logo
Developing on Windows 8
Developing on Windows 8




       Power point template by
          Colin Eberhardt
Agenda

WinRT Platform Basics

Best practices

Pickers

Contracts

Tiles

Notifications
Who am I




                           Einar Ingebrigtsen




       @einari           einar@dolittle.com




                        http://blog.dolittle.com
                 http://www.ingebrigtsen.info
The target
Old school interop
Windows RT style
Architecture
Bridging the gap



FileOpenPicker picker = new FileOpenPicker();
picker.FileTypeFilter.Add("*")a;

StorageFile file = await picker.PickSingleFileAsync();

Windows.Storage.Streams.IInputStream inputStream =
    await file.OpenReadAsync();



System.IO.Stream stream = inputStream.AsStreamForRead();
System.IO.StreamReader reader = new StreamReader(stream);

string contents = reader.ReadToEnd();
Missing things




Reflection API changed
 Type details through GetTypeInfo() – extension
 method
 Emit namespace practically empty - security
XAML


Originally developed for Windows Vista and
exposed as WPF

Defines what you see

Layout is by default not flowing, as in HTML

Can observe changes (Active View)
Tools
Binding

Source
 Defaults to DataContext
 Can use StaticResource as source


Mode
 OneWay, TwoWay, OneTime – OneWay default


Validation
 ValidatesOnException
 ValidatesOnNotifyDataErrors
   INotifyDataErrorInfo
Binding


StringFormat
 StringFormat = „MMM.dd.yyyy‟


Null and Fallback values
 TargetNullValue=„(None)‟
 FallbackValue=„(Data Context Not Set)‟


IValueConverter
Element to Element




Can bind directly to other elements
properties

Binds by name of element
Events



You still have events as before – buttons can
be clicked and raise an event

RoutedEvents – bubbles through the UI
Async

var data = DownloadData(...);
ProcessData(data);
                       STOP



       DownloadData             ProcessData




var future = DownloadDataAsync(...);
future.ContinueWith(data => ProcessData(data));



       DownloadDataAsync        ProcessData
Async Models



Windows Runtime : IAsyncOperation<T>

.NET Framework : Task<T>

C# 5.0 – async / await
Async – C# style


Marked with “async” modifier

Must return void or Task<T>

Use “await” operator to cooperatively yield
control – remember to mark with “async”

Feels just like good old synchronous code
Patterns & Practices

MVVM
 Inspired by PresentationModel by Martin Fowler
 Good for decoupling – promotes testability


Compositioning

Commands

Actions / Triggers / Behaviors
MVVM



                     Model



              View
   Observes



                 ViewModel   Observable
Compositional UIs



     Navigation   Header




                  Main Content



                  Footer
Event Aggregator



ViewModel 1                ViewModel 2




              Aggregator
Tiles

Tap on tile to launch or switch to an app

Static default tile specified in app manifest

Two sizes:




Both sizes can have live updates
Live Tiles




Tiles updates using     Templates provide        Text-only image-only
pre-defined templates   rich rendering options   or combination




JPEG or PNG
only, max size 150      Optional “peek”          Local or cloud
KB                      animation                updates
Notification Queuing
Secondary Tiles
Windows Notification Service

Enables delivery of tile and toast notification over the
internet

Tile updates and notifications shown to the user even if
your app is not running

WNS handles communication with your app

Scales to millions of users

WNS is a free service for your app to use
Push Notification Overview
                    1.   Request Channel URI

                    2.   Register with your Cloud Service

                    3.   Authenticate & Push Notification
Toast Notifications

Toast notifications deliver transient messages outside the context of the
app

Use toast notifications to get user‟s attention immediately

User is in control and can permanently turn off toast notifications from
your app

Allows quick navigation to a contextually relevant location in your app

Toast notifications are easy to invoke from your app or from the cloud
Toast Templates

Uses same template architecture as Live Tiles

Rich set of rendering options available
Contracts




Contracts enable integrating the Windows 8
         experience into your app

    Yields a consistent UI for all apps
Search




Enables your app to interact and respond to
 Suggestions
 Search Query
Settings




Consistently given one place to get search
 Context sensitive to the front facing app
Share




Your app can share anything (text, images, binaries)
  Automatically filters available applications to share to


Your app can be a share target – receive sharing from others
  Add sharing target as a capability and you can receive share requests
Play To




Ability to stream media to compatible devices
Developing on Windows 8
Summarized



Windows RT is a huge leap, both in faith but also technically

Consistent API that feels mature from day one

Well architected solutions putting the user first

Makes us as developers focus on adding the business value
Resources

The samples of today
  http://github.com/einari/toodeloo


Yggdrasil – IoC Container
  http://github.com/dolittlestudios/yggdrasil
  https://nuget.org/packages/Yggdrasil


INPC Weaver
  http://github.com/SimonCropp/NotifyPropertyWeaver


WinRT Toolkit
  http://jupitertoolkit.codeplex.com


Tiny IoC container - WinRT Compatible
  http://microsliver.codeplex.com/
Resources

MVVM Light
  http://mvvmlight.codeplex.com/


Setting up push notifications – registering your app
  https://manage.dev.live.com/build


WAT for Windows 8 + WnsRecipe
  http://watwindows8.codeplex.com/releases/view/73334


Calisto – UI Framework for WinRT
  https://github.com/timheuer/callisto


Get into the store – register as a deveveloper
  http://msdn.microsoft.com/en-us/windows/apps/
Thanks for your
   attention
Developing on Windows 8

More Related Content

PPTX
Get an Android tutorial for beginners
PPTX
Using prime[31] to connect your unity game to azure mobile services
PDF
Composite Enterprise Application Development with the WSO2 Developer Studio
PPT
Ios - Introduction to platform & SDK
PPTX
Develop for Windows 10 (Preview)
PPTX
Basic of Android App Development
PPTX
Android Services
PDF
Building and Deploying a Static Application using Jenkins and Docker in AWS
Get an Android tutorial for beginners
Using prime[31] to connect your unity game to azure mobile services
Composite Enterprise Application Development with the WSO2 Developer Studio
Ios - Introduction to platform & SDK
Develop for Windows 10 (Preview)
Basic of Android App Development
Android Services
Building and Deploying a Static Application using Jenkins and Docker in AWS

What's hot (11)

PPTX
Unity and Azure Mobile Services using Prime31 plugin
PPTX
Android architecture
PDF
Meteor.js for DOers
PPT
Developing Microsoft .NET Applications for Windows
PDF
Android tutorial
PDF
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
PPT
Android overview
PPTX
Visual Basic Controls ppt
PPTX
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
PDF
Empower every Azure Function to achieve more!!
PPTX
Appcelerator Titanium Intro
Unity and Azure Mobile Services using Prime31 plugin
Android architecture
Meteor.js for DOers
Developing Microsoft .NET Applications for Windows
Android tutorial
DOT NET LAB PROGRAM PERIYAR UNIVERSITY
Android overview
Visual Basic Controls ppt
What’s new in aNdroid [Google I/O Extended Bangkok 2016]
Empower every Azure Function to achieve more!!
Appcelerator Titanium Intro
Ad

Viewers also liked (17)

PPT
Genealogylecture2012
PPTX
Lets focus on business value
KEY
Sugarcoating your frontend one ViewModel at a time
PDF
SME Breakfast Seminar - Keynote Session - The Data Landscape
PPT
Pptsummativeassessment 130217030359-phpapp01
PDF
An Agile Journey
PPTX
Windows 8 BootCamp
PPTX
It's Primetime: A Javascript Story
PDF
Ausdance celebrates Australian dance at the 2014 Australian Performing Arts M...
PPT
Genealogylecture2012
PPTX
해맑은 어린이집 상담자료
PDF
HCB patents catalogue
PPT
Genealogylecture2012
PPTX
Windows Azure Camps - Oktober 2012
PPTX
Law Related ( Guidelines on the PTA )
PPTX
Laws related Education
PPT
Theoretical perspectives in sociology
Genealogylecture2012
Lets focus on business value
Sugarcoating your frontend one ViewModel at a time
SME Breakfast Seminar - Keynote Session - The Data Landscape
Pptsummativeassessment 130217030359-phpapp01
An Agile Journey
Windows 8 BootCamp
It's Primetime: A Javascript Story
Ausdance celebrates Australian dance at the 2014 Australian Performing Arts M...
Genealogylecture2012
해맑은 어린이집 상담자료
HCB patents catalogue
Genealogylecture2012
Windows Azure Camps - Oktober 2012
Law Related ( Guidelines on the PTA )
Laws related Education
Theoretical perspectives in sociology
Ad

Similar to Developing on Windows 8 (20)

PPTX
Windows 8 DevUnleashed - Session 1
PPTX
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
PPTX
Windows Store app using XAML and C#: Enterprise Product Development
PPTX
Developing Apps for Windows Phone 8
PPTX
Windows phone 8 overview
PPTX
Sharing code win8 wp8
PPTX
Iasi code camp 12 october 2013 adrian marinica - windows 8 and windows phon...
PPTX
Windows 8 store apps development
PDF
Apress.migrating.to.windows.phone.dec.2011
PPTX
Sinergija 12 WP8 is around the corner
PPT
WPF Applications, It's all about XAML these days
PPTX
A Day in the Life of a Metro-veloper
PDF
Windows phone 7 series
PPTX
Windows Phone 7 and Silverlight
PDF
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App ...
PPTX
Deep Dive into WinRT
PPTX
Eco system apps
PPT
What's New with Windows Phone - FoxCon Talk
PPTX
A Lap Around Windows Phone 8.1
PDF
Develop for Windows Phone Mango and Windows 8: our Tips
Windows 8 DevUnleashed - Session 1
Nashua Cloud .NET User Group - Basic WP8 App Dev With XAML and C#, April 2013
Windows Store app using XAML and C#: Enterprise Product Development
Developing Apps for Windows Phone 8
Windows phone 8 overview
Sharing code win8 wp8
Iasi code camp 12 october 2013 adrian marinica - windows 8 and windows phon...
Windows 8 store apps development
Apress.migrating.to.windows.phone.dec.2011
Sinergija 12 WP8 is around the corner
WPF Applications, It's all about XAML these days
A Day in the Life of a Metro-veloper
Windows phone 7 series
Windows Phone 7 and Silverlight
Sharing up to 80% code for iOS, Android, and Windows platforms, a Retail App ...
Deep Dive into WinRT
Eco system apps
What's New with Windows Phone - FoxCon Talk
A Lap Around Windows Phone 8.1
Develop for Windows Phone Mango and Windows 8: our Tips

Recently uploaded (20)

PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Cloud computing and distributed systems.
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
KodekX | Application Modernization Development
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPT
Teaching material agriculture food technology
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Electronic commerce courselecture one. Pdf
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPTX
Spectroscopy.pptx food analysis technology
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Cloud computing and distributed systems.
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
KodekX | Application Modernization Development
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
MIND Revenue Release Quarter 2 2025 Press Release
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Teaching material agriculture food technology
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Electronic commerce courselecture one. Pdf
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Spectroscopy.pptx food analysis technology
Agricultural_Statistics_at_a_Glance_2022_0.pdf

Developing on Windows 8

  • 2. Developing on Windows 8 Power point template by Colin Eberhardt
  • 3. Agenda WinRT Platform Basics Best practices Pickers Contracts Tiles Notifications
  • 4. Who am I Einar Ingebrigtsen @einari einar@dolittle.com http://blog.dolittle.com http://www.ingebrigtsen.info
  • 9. Bridging the gap FileOpenPicker picker = new FileOpenPicker(); picker.FileTypeFilter.Add("*")a; StorageFile file = await picker.PickSingleFileAsync(); Windows.Storage.Streams.IInputStream inputStream = await file.OpenReadAsync(); System.IO.Stream stream = inputStream.AsStreamForRead(); System.IO.StreamReader reader = new StreamReader(stream); string contents = reader.ReadToEnd();
  • 10. Missing things Reflection API changed Type details through GetTypeInfo() – extension method Emit namespace practically empty - security
  • 11. XAML Originally developed for Windows Vista and exposed as WPF Defines what you see Layout is by default not flowing, as in HTML Can observe changes (Active View)
  • 12. Tools
  • 13. Binding Source Defaults to DataContext Can use StaticResource as source Mode OneWay, TwoWay, OneTime – OneWay default Validation ValidatesOnException ValidatesOnNotifyDataErrors INotifyDataErrorInfo
  • 14. Binding StringFormat StringFormat = „MMM.dd.yyyy‟ Null and Fallback values TargetNullValue=„(None)‟ FallbackValue=„(Data Context Not Set)‟ IValueConverter
  • 15. Element to Element Can bind directly to other elements properties Binds by name of element
  • 16. Events You still have events as before – buttons can be clicked and raise an event RoutedEvents – bubbles through the UI
  • 17. Async var data = DownloadData(...); ProcessData(data); STOP DownloadData ProcessData var future = DownloadDataAsync(...); future.ContinueWith(data => ProcessData(data)); DownloadDataAsync ProcessData
  • 18. Async Models Windows Runtime : IAsyncOperation<T> .NET Framework : Task<T> C# 5.0 – async / await
  • 19. Async – C# style Marked with “async” modifier Must return void or Task<T> Use “await” operator to cooperatively yield control – remember to mark with “async” Feels just like good old synchronous code
  • 20. Patterns & Practices MVVM Inspired by PresentationModel by Martin Fowler Good for decoupling – promotes testability Compositioning Commands Actions / Triggers / Behaviors
  • 21. MVVM Model View Observes ViewModel Observable
  • 22. Compositional UIs Navigation Header Main Content Footer
  • 23. Event Aggregator ViewModel 1 ViewModel 2 Aggregator
  • 24. Tiles Tap on tile to launch or switch to an app Static default tile specified in app manifest Two sizes: Both sizes can have live updates
  • 25. Live Tiles Tiles updates using Templates provide Text-only image-only pre-defined templates rich rendering options or combination JPEG or PNG only, max size 150 Optional “peek” Local or cloud KB animation updates
  • 28. Windows Notification Service Enables delivery of tile and toast notification over the internet Tile updates and notifications shown to the user even if your app is not running WNS handles communication with your app Scales to millions of users WNS is a free service for your app to use
  • 29. Push Notification Overview 1. Request Channel URI 2. Register with your Cloud Service 3. Authenticate & Push Notification
  • 30. Toast Notifications Toast notifications deliver transient messages outside the context of the app Use toast notifications to get user‟s attention immediately User is in control and can permanently turn off toast notifications from your app Allows quick navigation to a contextually relevant location in your app Toast notifications are easy to invoke from your app or from the cloud
  • 31. Toast Templates Uses same template architecture as Live Tiles Rich set of rendering options available
  • 32. Contracts Contracts enable integrating the Windows 8 experience into your app Yields a consistent UI for all apps
  • 33. Search Enables your app to interact and respond to Suggestions Search Query
  • 34. Settings Consistently given one place to get search Context sensitive to the front facing app
  • 35. Share Your app can share anything (text, images, binaries) Automatically filters available applications to share to Your app can be a share target – receive sharing from others Add sharing target as a capability and you can receive share requests
  • 36. Play To Ability to stream media to compatible devices
  • 38. Summarized Windows RT is a huge leap, both in faith but also technically Consistent API that feels mature from day one Well architected solutions putting the user first Makes us as developers focus on adding the business value
  • 39. Resources The samples of today http://github.com/einari/toodeloo Yggdrasil – IoC Container http://github.com/dolittlestudios/yggdrasil https://nuget.org/packages/Yggdrasil INPC Weaver http://github.com/SimonCropp/NotifyPropertyWeaver WinRT Toolkit http://jupitertoolkit.codeplex.com Tiny IoC container - WinRT Compatible http://microsliver.codeplex.com/
  • 40. Resources MVVM Light http://mvvmlight.codeplex.com/ Setting up push notifications – registering your app https://manage.dev.live.com/build WAT for Windows 8 + WnsRecipe http://watwindows8.codeplex.com/releases/view/73334 Calisto – UI Framework for WinRT https://github.com/timheuer/callisto Get into the store – register as a deveveloper http://msdn.microsoft.com/en-us/windows/apps/
  • 41. Thanks for your attention

Editor's Notes

  • #13: Visual Studio : Code editor w/ IntellisenseUI Designer DebuggersSimulator Platform window Blend : Code editor WYSIGYG designer Animation Better properties window SimulatorPlatform window
  • #25: Metro App = one foreground full screen window that allows the user to work more efficientlyThe other Metro Apps are quickly suspended to preserve battery lifeAs a developer, you have to know how Windows manages your App lifetime and how to be a good citizenApps are suspended 5 seconds after leaving foreground.However, you get 10 seconds instead when you switch from one App to another.You can check it if you launch an App in Snap view and keep the Task Manager in the Filled view (I’m not able to find a workflow that ends up to the 5 seconds…)
  • #26: Metro App = one foreground full screen window that allows the user to work more efficientlyThe other Metro Apps are quickly suspended to preserve battery lifeAs a developer, you have to know how Windows manages your App lifetime and how to be a good citizenApps are suspended 5 seconds after leaving foreground.However, you get 10 seconds instead when you switch from one App to another.You can check it if you launch an App in Snap view and keep the Task Manager in the Filled view (I’m not able to find a workflow that ends up to the 5 seconds…)