0
Developing on Windows 8       Power point template by          Colin Eberhardt
AgendaWinRT Platform BasicsBest practicesPickersContractsTilesNotifications
Who am I                           Einar Ingebrigtsen       @einari           einar@dolittle.com                        ht...
The target
Old school interop
Windows RT style
Architecture
Bridging the gapFileOpenPicker picker = new FileOpenPicker();picker.FileTypeFilter.Add("*")a;StorageFile file = await pick...
Missing thingsReflection API changed Type details through GetTypeInfo() – extension method Emit namespace practically empt...
XAMLOriginally developed for Windows Vista andexposed as WPFDefines what you seeLayout is by default not flowing, as in HT...
Tools
BindingSource Defaults to DataContext Can use StaticResource as sourceMode OneWay, TwoWay, OneTime – OneWay defaultValidat...
BindingStringFormat StringFormat = „MMM.dd.yyyy‟Null and Fallback values TargetNullValue=„(None)‟ FallbackValue=„(Data Con...
Element to ElementCan bind directly to other elementspropertiesBinds by name of element
EventsYou still have events as before – buttons canbe clicked and raise an eventRoutedEvents – bubbles through the UI
Asyncvar data = DownloadData(...);ProcessData(data);                       STOP       DownloadData             ProcessData...
Async ModelsWindows Runtime : IAsyncOperation<T>.NET Framework : Task<T>C# 5.0 – async / await
Async – C# styleMarked with “async” modifierMust return void or Task<T>Use “await” operator to cooperatively yieldcontrol ...
Patterns & PracticesMVVM Inspired by PresentationModel by Martin Fowler Good for decoupling – promotes testabilityComposit...
MVVM                     Model              View   Observes                 ViewModel   Observable
Compositional UIs     Navigation   Header                  Main Content                  Footer
Event AggregatorViewModel 1                ViewModel 2              Aggregator
TilesTap on tile to launch or switch to an appStatic default tile specified in app manifestTwo sizes:Both sizes can have l...
Live TilesTiles updates using     Templates provide        Text-only image-onlypre-defined templates   rich rendering opti...
Notification Queuing
Secondary Tiles
Windows Notification ServiceEnables delivery of tile and toast notification over theinternetTile updates and notifications...
Push Notification Overview                    1.   Request Channel URI                    2.   Register with your Cloud Se...
Toast NotificationsToast notifications deliver transient messages outside the context of theappUse toast notifications to ...
Toast TemplatesUses same template architecture as Live TilesRich set of rendering options available
ContractsContracts enable integrating the Windows 8         experience into your app    Yields a consistent UI for all apps
SearchEnables your app to interact and respond to Suggestions Search Query
SettingsConsistently given one place to get search Context sensitive to the front facing app
ShareYour app can share anything (text, images, binaries)  Automatically filters available applications to share toYour ap...
Play ToAbility to stream media to compatible devices
SummarizedWindows RT is a huge leap, both in faith but also technicallyConsistent API that feels mature from day oneWell a...
ResourcesThe samples of today  http://github.com/einari/toodelooYggdrasil – IoC Container  http://github.com/dolittlestudi...
ResourcesMVVM Light  http://mvvmlight.codeplex.com/Setting up push notifications – registering your app  https://manage.de...
Thanks for your   attention
Developing on Windows 8
Developing on Windows 8
Developing on Windows 8
Upcoming SlideShare
Loading in...5
×

Developing on Windows 8

1,053

Published on

A presentation on Windows 8 development I gave at NNUG Vestfold the 26th of September 2012

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,053
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Visual Studio : Code editor w/ IntellisenseUI Designer DebuggersSimulator Platform window Blend : Code editor WYSIGYG designer Animation Better properties window SimulatorPlatform window
  • 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…)
  • 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…)
  • Transcript of "Developing on Windows 8"

    1. 1. Developing on Windows 8 Power point template by Colin Eberhardt
    2. 2. AgendaWinRT Platform BasicsBest practicesPickersContractsTilesNotifications
    3. 3. Who am I Einar Ingebrigtsen @einari einar@dolittle.com http://blog.dolittle.com http://www.ingebrigtsen.info
    4. 4. The target
    5. 5. Old school interop
    6. 6. Windows RT style
    7. 7. Architecture
    8. 8. Bridging the gapFileOpenPicker 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();
    9. 9. Missing thingsReflection API changed Type details through GetTypeInfo() – extension method Emit namespace practically empty - security
    10. 10. XAMLOriginally developed for Windows Vista andexposed as WPFDefines what you seeLayout is by default not flowing, as in HTMLCan observe changes (Active View)
    11. 11. Tools
    12. 12. BindingSource Defaults to DataContext Can use StaticResource as sourceMode OneWay, TwoWay, OneTime – OneWay defaultValidation ValidatesOnException ValidatesOnNotifyDataErrors INotifyDataErrorInfo
    13. 13. BindingStringFormat StringFormat = „MMM.dd.yyyy‟Null and Fallback values TargetNullValue=„(None)‟ FallbackValue=„(Data Context Not Set)‟IValueConverter
    14. 14. Element to ElementCan bind directly to other elementspropertiesBinds by name of element
    15. 15. EventsYou still have events as before – buttons canbe clicked and raise an eventRoutedEvents – bubbles through the UI
    16. 16. Asyncvar data = DownloadData(...);ProcessData(data); STOP DownloadData ProcessDatavar future = DownloadDataAsync(...);future.ContinueWith(data => ProcessData(data)); DownloadDataAsync ProcessData
    17. 17. Async ModelsWindows Runtime : IAsyncOperation<T>.NET Framework : Task<T>C# 5.0 – async / await
    18. 18. Async – C# styleMarked with “async” modifierMust return void or Task<T>Use “await” operator to cooperatively yieldcontrol – remember to mark with “async”Feels just like good old synchronous code
    19. 19. Patterns & PracticesMVVM Inspired by PresentationModel by Martin Fowler Good for decoupling – promotes testabilityCompositioningCommandsActions / Triggers / Behaviors
    20. 20. MVVM Model View Observes ViewModel Observable
    21. 21. Compositional UIs Navigation Header Main Content Footer
    22. 22. Event AggregatorViewModel 1 ViewModel 2 Aggregator
    23. 23. TilesTap on tile to launch or switch to an appStatic default tile specified in app manifestTwo sizes:Both sizes can have live updates
    24. 24. Live TilesTiles updates using Templates provide Text-only image-onlypre-defined templates rich rendering options or combinationJPEG or PNGonly, max size 150 Optional “peek” Local or cloudKB animation updates
    25. 25. Notification Queuing
    26. 26. Secondary Tiles
    27. 27. Windows Notification ServiceEnables delivery of tile and toast notification over theinternetTile updates and notifications shown to the user even ifyour app is not runningWNS handles communication with your appScales to millions of usersWNS is a free service for your app to use
    28. 28. Push Notification Overview 1. Request Channel URI 2. Register with your Cloud Service 3. Authenticate & Push Notification
    29. 29. Toast NotificationsToast notifications deliver transient messages outside the context of theappUse toast notifications to get user‟s attention immediatelyUser is in control and can permanently turn off toast notifications fromyour appAllows quick navigation to a contextually relevant location in your appToast notifications are easy to invoke from your app or from the cloud
    30. 30. Toast TemplatesUses same template architecture as Live TilesRich set of rendering options available
    31. 31. ContractsContracts enable integrating the Windows 8 experience into your app Yields a consistent UI for all apps
    32. 32. SearchEnables your app to interact and respond to Suggestions Search Query
    33. 33. SettingsConsistently given one place to get search Context sensitive to the front facing app
    34. 34. ShareYour app can share anything (text, images, binaries) Automatically filters available applications to share toYour app can be a share target – receive sharing from others Add sharing target as a capability and you can receive share requests
    35. 35. Play ToAbility to stream media to compatible devices
    36. 36. SummarizedWindows RT is a huge leap, both in faith but also technicallyConsistent API that feels mature from day oneWell architected solutions putting the user firstMakes us as developers focus on adding the business value
    37. 37. ResourcesThe samples of today http://github.com/einari/toodelooYggdrasil – IoC Container http://github.com/dolittlestudios/yggdrasil https://nuget.org/packages/YggdrasilINPC Weaver http://github.com/SimonCropp/NotifyPropertyWeaverWinRT Toolkit http://jupitertoolkit.codeplex.comTiny IoC container - WinRT Compatible http://microsliver.codeplex.com/
    38. 38. ResourcesMVVM Light http://mvvmlight.codeplex.com/Setting up push notifications – registering your app https://manage.dev.live.com/buildWAT for Windows 8 + WnsRecipe http://watwindows8.codeplex.com/releases/view/73334Calisto – UI Framework for WinRT https://github.com/timheuer/callistoGet into the store – register as a deveveloper http://msdn.microsoft.com/en-us/windows/apps/
    39. 39. Thanks for your attention
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×