Skip to content

Instantly share code, notes, and snippets.

@4E71
Last active October 12, 2015 18:38
Show Gist options
  • Save 4E71/4069997 to your computer and use it in GitHub Desktop.
Save 4E71/4069997 to your computer and use it in GitHub Desktop.
win8: notes
// Plan
//--------------------------------------
// Planning Windows Store apps
http://msdn.microsoft.com/en-us/library/windows/apps/hh465427
// Design inspiration
http://msdn.microsoft.com/en-us/library/windows/apps/hh868274.aspx
// Build
//--------------------------------------
// Building a Windows 8 App with HTML5
http://www.sitepoint.com/building-a-windows-8-app-with-html5-how-to-create-a-small-rss-reader/
// JavaScript project templates for Windows Store apps (Windows)
http://msdn.microsoft.com/en-us/library/windows/apps/hh758331.aspx
// Using ListView
http://msdn.microsoft.com/en-us/library/windows/apps/Hh781224.aspx
// How to create a custom data source
http://msdn.microsoft.com/en-us/library/windows/apps/hh770849.aspx
// Asynchronous programming in JavaScript
http://msdn.microsoft.com/en-us/library/windows/apps/hh700330.aspx
// Asynchronous Programming in JavaScript with “Promises”
http://blogs.msdn.com/b/ie/archive/2011/09/11/asynchronous-programming-in-javascript-with-promises.aspx
// The basics of web workers
http://www.html5rocks.com/en/tutorials/workers/basics/
// Displaying items with a Template or render function (when performance is a concern)
http://msdn.microsoft.com/en-us/library/windows/apps/Hh781224.aspx#displaying_items_with_a_template_or_render_function
// Adding data to a project template
http://msdn.microsoft.com/en-us/library/windows/apps/hh758329.aspx
// Binding example data to the UI in the Grid template
http://msdn.microsoft.com/en-us/library/windows/apps/hh758329.aspx#binding_data_to_the_ui_in_the_grid_template
// Quickstart: adding WinJS controls and styles
http://msdn.microsoft.com/en-us/library/windows/apps/hh465493.aspx
File access and permissions in Windows Store apps (Windows)
http://msdn.microsoft.com/en-us/library/windows/apps/hh967755.aspx
// Windows Web App (WWA)
Issue: local vs remote use of javascript libraries
"Using any CDN won't work as you can't load external JavaScript files in a Metro JavaScript application."
http://stackoverflow.com/questions/7526360/jquery-in-windows-8-js-applications
// General Issues:
* will jQuery AJAX calls work with WinJS.xhr?
* JSONP is not supported because script element injection is considered security issue by WinJS.
* WinJs.Binding.List binds synchronously using a JavaScript Array, which does not scale well for large datasets.
http://msdn.microsoft.com/en-us/library/windows/apps/Hh781224.aspx
// Cache
Cached files prevent subsequent launching of Windows 8 Apps that use WinJs.hxr:
Reference: http://blogs.msdn.com/b/wriju/archive/2012/10/17/winjs-xhr-issue-while-running-next-time.aspx
tl;dr
disable cache
return WinJS.xhr({
url: url1,
headers: { "Cache-Control": "no-cache", "If-Modified-Since": "Mon, 27 Mar 1972 00:00:00 GMT" }
});
// Regular Expressions - User Guide
http://www.zytrax.com/tech/web/regex.htm
WCF Data Services 5.0
If JSONP (JSON w/Padding) is needed for cross domain query using ?$format=json:
1. Download JSONPSupportBehavior class from http://archive.msdn.microsoft.com/DataServicesJSONP and add to WCF data service project
2. Add addtribute, [JSONPSupportBehavior] to data service class
3. Modified header in AfterReceiveRequest method of JSONPSupportBehavior class to use: "application/json;odata=verbose"
An alternative would be CORS (Cross-Origin resource sharing).
Reference: http://blogs.msdn.com/b/astoriateam/archive/2012/04/11/what-happened-to-application-json-in-wcf-ds-5-0.aspx
// http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/introduction-to-wcf-data-service-and-odata/
http://www.c-sharpcorner.com/uploadfile/dhananjaycoder/introduction-to-wcf-data-service-and-odata/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment