00
I really don't want to be a grumpy and bitter developer but #microsoft doesn't
make it easy to stay enthusiastic as a #wpf dev. 03.02.2011
@microsoft is king of FUD strategy. causes fear, uncertainty and doubt to
devs around the world. pity they do it to *their* own devs #wpf 25.08.2011
not a single mention of #wpf in #bldwin keynote - it's as if it doesn't exist. the
XAML thing they talk about is prop closer to #silverlight 12.09.2011
RT @JohnBristowe: Me, attempting to build a Windows 8 app in JavaScript for
the past 30 minutes: http://t.co/TwTrwZic 09.03.2012
@JohnBristowe that's me today as well :(
although all in all JS in Win8 is surprisingly fun :)
09.03.2012
implemented my first 3D transformation
animation in CSS yesterday. astonishingly
simple. 13.05.2012
it constantly surprises me how easy it is to
create fluent animations in HTML/JS in all
sort of scenarios. simply not possible in
WPF. 22.05.2012
Announcement: (Game Dev Tycoon) is the #win8 game I've
been working on the past months. Store review is underway :)
04.07.2012
Announcement: A new NovaMind app is now available on
the Windows Store. #mindmapping http://t.co/aLSPv6bA
27.07.2012
[…] I was extremely surprised how pleasant porting code
from C# was. JS is also surprisingly fast in IE10.
27.07.2012
Couple of months ago I switched from C# to JavaScript.
Surprisingly, I don't miss C# one bit. JavaScript is bloody
amazing. 10.08.2012
Using HTML5/JS on WinRT is the most rewarding and
productive environment I’ve ever worked with
– just now
then
then
Threadpool
Advantages
using Windows.Media.Capture;
…
async void GetPicture()
{
var new CameraCaptureUI
new Size
var await CameraCaptureUIMode
if
var new BitmapImage
await FileAccessMode
JavaScript: Promises handle Async
Object that is a promise for a later value
Hook up to completion with then() or done () method
then(completion, error, progress)
then() returns another promise
Implementation in base.js: WinJS.Promise
Common.js promises/A spec
http://wiki.commonjs.org/wiki/Promises/A
DllImport "avicap32.dll" "capCreateCaptureWindow"
static extern int
string int
int int int int
int int
DllImport "avicap32.dll"
static extern bool
int
MarshalAs UnmanagedType ref string
int
MarshalAs UnmanagedType ref string
int
// more and more of the same
using Windows.Media.Capture;
var new CameraCaptureUI
new Size
var await CameraCaptureUIMode
if
var new BitmapImage
await FileAccessMode
IReadOnlyDictionary<K,V>IMapView<K,V>
IEnumerable<T>IIterable<T>
IList<T>IVector<T>
IReadOnlyList<T>IVectorView<T>
IDictionary<K,V>IMap<K,V>
Windows 8 System manages app lifetimeWindows 7 User manages app lifetime
App gets 5
seconds to work
after suspend
message
Apps are not
notified before
they are
terminated
Apps are
notified when
they have been
resumed
<!– Step1: declare control -->
<div id=“list” data-win-
control="WinJS.UI.ListView" data-win-options="{
selectionMode: 'none' }"></div>
/* Step 2: Call WinJS.UI.processAll() */
/* Step 3: Use the control */
document.getElementById(‘list’).winControl.addEve
ntListener (‘selectionchanged’, onSelChanged );
Everyday widgets
Presenting data
<!– Step1: declare template -->
<div class="itemtemplate" data-win-control="WinJS.Binding.Template">
<div class="item">
<img class="item-image" src="#" data-win-bind="src: backgroundImage;
alt: title" />
<div class="item-overlay">
<h4 class="item-title" data-win-bind="textContent: shortTitle"></h4>
<div class="item-subtitle" data-win-control="WinJS.UI.Rating" data-win-
options="{disabled: true}" data-win-bind="winControl.userRating: rating"></div>
</div>
</div>
</div>
/* step2: use the Data Template */
ui.setOptions(listView, {
oniteminvoked: this.itemInvoked });
Commanding surfaces
Tech ed au 2012 dev212

Tech ed au 2012 dev212

  • 1.
  • 20.
    I really don'twant to be a grumpy and bitter developer but #microsoft doesn't make it easy to stay enthusiastic as a #wpf dev. 03.02.2011 @microsoft is king of FUD strategy. causes fear, uncertainty and doubt to devs around the world. pity they do it to *their* own devs #wpf 25.08.2011
  • 21.
    not a singlemention of #wpf in #bldwin keynote - it's as if it doesn't exist. the XAML thing they talk about is prop closer to #silverlight 12.09.2011
  • 25.
    RT @JohnBristowe: Me,attempting to build a Windows 8 app in JavaScript for the past 30 minutes: http://t.co/TwTrwZic 09.03.2012 @JohnBristowe that's me today as well :( although all in all JS in Win8 is surprisingly fun :) 09.03.2012
  • 26.
    implemented my first3D transformation animation in CSS yesterday. astonishingly simple. 13.05.2012 it constantly surprises me how easy it is to create fluent animations in HTML/JS in all sort of scenarios. simply not possible in WPF. 22.05.2012
  • 27.
    Announcement: (Game DevTycoon) is the #win8 game I've been working on the past months. Store review is underway :) 04.07.2012
  • 29.
    Announcement: A newNovaMind app is now available on the Windows Store. #mindmapping http://t.co/aLSPv6bA 27.07.2012 […] I was extremely surprised how pleasant porting code from C# was. JS is also surprisingly fast in IE10. 27.07.2012
  • 39.
    Couple of monthsago I switched from C# to JavaScript. Surprisingly, I don't miss C# one bit. JavaScript is bloody amazing. 10.08.2012 Using HTML5/JS on WinRT is the most rewarding and productive environment I’ve ever worked with – just now
  • 45.
  • 47.
    using Windows.Media.Capture; … async voidGetPicture() { var new CameraCaptureUI new Size var await CameraCaptureUIMode if var new BitmapImage await FileAccessMode
  • 49.
    JavaScript: Promises handleAsync Object that is a promise for a later value Hook up to completion with then() or done () method then(completion, error, progress) then() returns another promise Implementation in base.js: WinJS.Promise Common.js promises/A spec http://wiki.commonjs.org/wiki/Promises/A
  • 54.
    DllImport "avicap32.dll" "capCreateCaptureWindow" staticextern int string int int int int int int int DllImport "avicap32.dll" static extern bool int MarshalAs UnmanagedType ref string int MarshalAs UnmanagedType ref string int // more and more of the same
  • 55.
    using Windows.Media.Capture; var newCameraCaptureUI new Size var await CameraCaptureUIMode if var new BitmapImage await FileAccessMode
  • 59.
  • 65.
    Windows 8 Systemmanages app lifetimeWindows 7 User manages app lifetime
  • 66.
    App gets 5 secondsto work after suspend message Apps are not notified before they are terminated Apps are notified when they have been resumed
  • 72.
    <!– Step1: declarecontrol --> <div id=“list” data-win- control="WinJS.UI.ListView" data-win-options="{ selectionMode: 'none' }"></div> /* Step 2: Call WinJS.UI.processAll() */ /* Step 3: Use the control */ document.getElementById(‘list’).winControl.addEve ntListener (‘selectionchanged’, onSelChanged );
  • 73.
  • 74.
  • 75.
    <!– Step1: declaretemplate --> <div class="itemtemplate" data-win-control="WinJS.Binding.Template"> <div class="item"> <img class="item-image" src="#" data-win-bind="src: backgroundImage; alt: title" /> <div class="item-overlay"> <h4 class="item-title" data-win-bind="textContent: shortTitle"></h4> <div class="item-subtitle" data-win-control="WinJS.UI.Rating" data-win- options="{disabled: true}" data-win-bind="winControl.userRating: rating"></div> </div> </div> </div> /* step2: use the Data Template */ ui.setOptions(listView, { oniteminvoked: this.itemInvoked });
  • 76.

Editor's Notes

  • #6 First part of many parts talking about Windows 8 development here at TechEd
  • #9 Changing World User interaction methods Piaget’s Theory of Cognitive Development; Sensorimotor stage (birth to 2 yrs) 8-12 months coordination of hand/eye with schemes and intentionality. Logic, means & ends. “First proper intelligence” Jean Piaget, Swiss developmental psychologist.
  • #10 The internet
  • #14 In visual studio
  • #18 “Sort of like BCL for Javascript” app development on Windows 8
  • #51 Implemented by jQuery, dojo, node.js, etc. Then returns another promise so you can chain them… C++ has a similar mechanism through the PPL
  • #53 What are the APIs that we’ve got available to us? ALL OF THEM
  • #55 We talked about projections already. What we didn’t talk about is the idea that we can author new components in C# and C++. These are new WinRT components and we can then consume them in JavaScript/C#/C++ - produces WinMD files that can be consumed anywhere.
  • #58 WinRT is based on COM, interfaces, so doesn’t feel natural in OO lang. Projections take care of this so it feels natural.
  • #62 let’s switch gears and talk about where and how these applications run.
  • #63 we’ve already talked about how apps come from a store.
  • #64 The app package (Appx) is abb OPC file ( a zip) The package It includes anything necessary to deploy or uninstall – It includes capabilities and declartions so we know the impact in the system. In the package you will see JS files etc. If in C++ see .dll files and what you would expect. Blockmap is a series of hashes for each block in your package. Combination of signature + blockmap verifies the package.. It can be validated as it comes off-the wire… we don’t have to download the whole thing..
  • #65 and when your app is running, it’s not necessarily making direct API calls to the OS. a lot of APIs are “brokered” and that “broker” decides what to do based on a manifest that’s part of your app. There are APIs that we can’t just allow to “happen” without the user’s consent and so your application needs to say what it’s going to try and do and the user needs to be in control of that.
  • #66 The app has to declare what the app wants to do ( capabilities ) which can still be turned down by the user and it also has to declare what it can do on behalf of the operating system or other apps ( i.e. declarations ).
  • #67 this is a huge change and one that developers need to get from day 1. the OS is in control of when your app runs. it will definitely suspend it. it may also kill it. you need to code for this from the first line of code that you write.
  • #68 the basics of it.
  • #69 BACKGROUND TASKS Register for events Register for time-based; Table 1 – Background task trigger events Trigger event When the background task is triggered ControlChannelTrigger On incoming messages on the control channel. InternetAvailable The Internet becomes available. InternetNotAvailable The Internet becomes unavailable. LockScreenApplicationAdded An app tile is added to the lock screen. LockScreenApplicationRemoved An app tile is removed from the lock screen. MaintenanceTrigger It’s time for maintenance background tasks. NetworkNotificationChannelReset A network channel is reset. NetworkStateChange A network change such as a change in cost or connectivity occurs. OnlineIdConnectedStateChange Online ID associated with the account changes. PushNotificationTrigger A raw notification arrives on the WNS channel. ServicingComplete The system has finished updating an application. SessionConnected The session is connected. SessionDisconnected The session is disconnected. SessionStart The user session starts. SmsReceived A new SMS message is received by an installed mobile broadband device. TimeTrigger A time event occurs. TimeZoneChange The time zone changes on the device (for example, when the system adjusts the clock for daylight saving time). UserAway The user becomes absent. UserPresent The user becomes present.
  • #71 Apps need to store things and especially if they are going to work well online/offline. The app can store its own data like settings, files, session, cache etc and we give it isolated space on the disk to do that. App has 3 folders – local, temp and roaming. Local is for most things. Temp is for stuff you don’t mind losing. However, the user’s data is owned by them and the app has to first ask for the capability to interact with these libraries or take files from the user via the file picker. An app can’t simply open up the user’s photos and start sending them over the internet.
  • #72 App has that 3rd folder called roaming. Subject to size and timing, this data is then roamed to other PCs where the user uses the same Microsoft Account (unless the user chooses not to do this). We saw the settings for this in the demo earlier on.
  • #73 App has that 3rd folder called roaming. Subject to size and timing, this data is then roamed to other PCs where the user uses the same Microsoft Account (unless the user chooses not to do this). We saw the settings for this in the demo earlier on.