Developing Windows 8 Style Application With HTML and JavaScript Lino Tadros | Falafel Software
The big picture
The tools are there! Code Editor WYSIGYG designer Interactive mode Animation Smarter Properties Window Simulator Platform window Expression Blend Code editor w/ Intellisense UI Designer Debuggers DOM Explorer Javascript Console Simulator Platform window Visual Studio
Windows Library for JavaScript Web technologies you’re already familiar with Modern patterns for responsive, reliable apps Use interactive design tools Build your apps fast and with high quality Matches the Windows 8 design style Controls for common user experiences Designed for touch as well as traditional input Scales across form factors Make your apps look and feel great
WinJS Helpers for Namespaces, Constructor Definition Promises App Model Navigation Page & User controls Animations Templates Utilities Default CSS Styles Data binding Controls
Promises handle Async
Promise Code
Host Enforcement Prevents potentially “bad” HTML from getting inserted Script blocks, iframes, event handlers, etc. Kicks in when setting strings innerHTML outerHTML setAdjacentHTML “data-” attributes in general not on the allowed list WinJS specific ones are ok
Host Enforcement Escape Hatches Can work around when needed: toStaticHTML method Use DOM creation APIs Use WinJS.Utilities.setInnerHTMLUnsafe Use msWWA.execUnsafeLocalFunction
Everyday Widgets
Presenting Data List View (ListLayout) ListView (with GridLayout) Flip View
Controls
DataBinding
Commanding Surfaces
Windows 8 Animation Library Contains key Metro style app animations Has the same storyboard values, curves, and even the same API that Windows uses Aligns your app to the Windows 8 personality
Animation Library Scenarios Content enterContent/exitContent Expand/collapse Peek Reveal/Hide UI showEdgeUI/hideEdgeUI showPanel/hidePanel showPopup/hidePopup Navigation enterPage/exitPage Selection Pointer animations Swipe select/swipe deselect Swipe reveal Collections AddItemToList Delete item from list
Basic Tiles Overlays status on top of tile Supports square and wide tiles Number up to 99 or pre-defined glyph: Always legible on top of images Badge
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 Toast notifications use the same template architecture as Live Tiles Rich set of rendering options available
Contracts ShareSettingsSearch App to App PickingPlay To
Search Anatomy 1. Search box is scoped to the main app on screen 2. Query suggestions provided by the main app on screen Autocompletes to terms for which the app has search results 3. List of installed Metro style apps that have implemented the search contract
Search Anatomy 4. Result suggestions provided by the main app on screen Must include a thumbnail and title Indicates a strong or exact match result Takes users directly to the details of the result
Implementing Search
Lino Tadros | Falafel Software