280 likes | 398 Views
TechDays 12. Introduction on the development of Windows Store apps using HTML5/JavaScript/CSS3. Mat Velloso Senior Software Development Engineer Microsoft Products and Services IT – Engineering Architecture. Agenda. Starting simple – the basics Layouts and CSS WinJS Navigation
E N D
TechDays 12 Introduction on the development of Windows Store apps using HTML5/JavaScript/CSS3 Mat Velloso Senior Software Development Engineer Microsoft Products and Services IT – Engineering Architecture
Agenda Starting simple – the basics Layouts and CSS WinJS Navigation Contracts overview Controls Lists Debugging
Using the Blank Project Template A.K.A. “Start from zero”
So you can: Work with almost no Win 8 specific JS code Work with same kind of HTML you already know Reuse many of the well-known JavaScript libraries
WinJS does many different things Application management (events, roaming settings, session, error handling) Handles promises (async code) Logging Resource access Security checks (strictProcessing) Web calls (xhr)
WinJS does many different things (2) Animations Classes declaration/definition Data binding General utilities Namespaces declaration Single Page Navigation UI controls Windows 8 integration
“Old school”, request-response navigation Web Server Page1 Page 2 Page 3 Browser
Single page navigation Web Server Page Browser
How WinJS does it? Default.html Page1 Page2 Page3 WinJS
Using the Navigation App Project Template Navigation Template Blank Template
Do you ‘have’ to use WinJS navigation? No Well, yes if…
Search 1 2 Search box is scoped to the main app on screen Query suggestions provided by the main app on screen Autocompletes to terms for which the app has search results List of installed Metro style apps that have implemented the search contract 3
Search 4 Result suggestions provided by the main app on screen
Share dataTransferManager.addEventListener("datarequested", function (e) { … // Common properties varrequest = e.request; request.data.properties.title = "Title for data"; request.data.properties.description= "Description of the data"; request.data.properties.thumbnail = thumbnail;// of type StreamReference // Common methods request.data.setText("Text to share"); request.data.setHtml("<HTML …>"); request.data.setUri(uri/* of type Uri */); request.data.setBitmap(stream /* RandomAccessStream */); // Custom data request.data.setText("FormatID", "Text to share"); request.data.setData("FormatID", datastream/* RandomAccessStream */);
Settings functionscenario2AddSettingsFlyout(){ WinJS.Application.onsettings=function(e){ e.detail.applicationcommands={"helpDiv":{title:"Help", href:"/html/2-SettingsFlyout-Help.html"}}; WinJS.UI.SettingsFlyout.populateSettings(e); }; }
Thank you Mat Velloso mat.velloso@microsoft.com