What is new: Windows Store and Windows Phone
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Alternative Title |
| |
Title of Series | ||
Number of Parts | 170 | |
Author | ||
License | CC Attribution - NonCommercial - ShareAlike 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal and non-commercial purpose as long as the work is attributed to the author in the manner specified by the author or licensor and the work or content is shared also in adapted form only under the conditions of this | |
Identifiers | 10.5446/50546 (DOI) | |
Publisher | ||
Release Date | ||
Language |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
NDC Oslo 201410 / 170
2
3
5
6
8
11
12
16
21
22
23
27
31
35
37
42
43
45
47
48
49
50
52
54
56
57
58
61
65
66
67
71
74
77
80
81
83
84
85
87
88
89
90
91
94
95
96
97
98
100
102
107
108
112
114
115
116
118
120
121
122
123
126
127
128
130
133
135
137
138
139
140
141
142
143
144
145
147
148
149
150
153
155
156
157
158
159
160
161
162
163
166
169
170
00:00
Twin primeSoftwareSoftware developerWindowData storage deviceLibrary (computing)Covering spaceBitSpacetimeLaptopMathematicsHand fanComponent-based software engineeringGoodness of fitSpecial unitary groupGroup actionType theorySlide ruleGraph coloringMultiplication signComputer architectureUniverse (mathematics)Software developerIdentity managementInformationMeasurementMobile appAuthorizationSocial classPopulation densityMessage passingFreewareComputer animation
02:38
Windows PhoneMobile appComponent-based software engineeringExtension (kinesiology)Sample (statistics)Condition numberTouchscreenBackupTemplate (C++)AerodynamicsMemory managementOvalTask (computing)Motion captureInternet service providerRing (mathematics)Wallpaper groupExecution unitMobile appBackupSocial classWindowData storage deviceTouchscreenWallpaper groupRevision controlTesselationMotion captureElectronic mailing listRun time (program lifecycle phase)Plug-in (computing)Sampling (statistics)Computing platformWeb applicationCartesian coordinate systemMultiplication signProcess (computing)Expected valueSingle-precision floating-point formatLibrary (computing)BitComputer configurationVisualization (computer graphics)Asynchronous Transfer ModeNeuroinformatikSpeech synthesisForestComputer fileFormal grammarSlide rulePortable communications deviceBuildingGroup actionComponent-based software engineeringMathematicsChannel capacityPattern recognitionMobile WebUniverse (mathematics)Memory managementGreen's functionService (economics)Condition numberLine (geometry)Software developer1 (number)Machine visionForm (programming)Point (geometry)Video gameUniform resource locatorNatural languageMathematical singularityTemplate (C++)Online helpProzesssimulationProjective planeTask (computing)Internet service providerPhysical lawAdditionComputer animation
08:53
Projective planeGroup actionWindowMultiplication signMobile appPoint (geometry)Computer fileRight angleRevision controlDifferent (Kate Ryan album)Greatest elementComputer configurationSlide ruleComputing platformComputer animation
10:30
DecimalTemplate (C++)TrailPresentation of a groupCartesian coordinate systemProjective planeWindowFormal languageWeb browserGame controllerApplication service providerAxiom of choiceBitMathematicsGastropod shellBit rateInternetworkingTemplate (C++)Software developerComputer animation
12:12
Cartesian coordinate systemAngleResultantBit rateValidity (statistics)EmulatorWeb applicationRight anglePatch (Unix)Projective planeAsynchronous Transfer ModeTemplate (C++)Slide ruleClosed setDynamical systemGame controllerLibrary (computing)Scripting languageData storage deviceJava appletFunctional (mathematics)NeuroinformatikProduct (business)Multiplication signMedical imagingStructural loadLocal ringWindowWeb 2.0Presentation of a groupWeb browserCodeComputer animation
15:40
Stack (abstract data type)GUI widgetMobile appCodeView (database)Template (C++)Computing platformMoment (mathematics)Slide ruleExpected valueDifferent (Kate Ryan album)Cartesian coordinate systemType theoryWindowMobile appTablet computerStack (abstract data type)Universe (mathematics)Projective planeCodeGame controllerSystem callData storage deviceLengthView (database)Multiplication signComputer animation
17:29
WindowProjective planeData storage deviceLibrary (computing)Component-based software engineeringTouchscreenCartesian coordinate systemGame controllerBitCodeCompilation albumUniverse (mathematics)Web pageCondition numberComputer clusterBlock (periodic table)Software developerInteractive televisionComputer fileComputing platformDifferent (Kate Ryan album)Symbol table1 (number)Function (mathematics)Goodness of fitScaling (geometry)Compiler2 (number)Point (geometry)Right angleWater vaporCategory of beingGraph coloringIntelMultiplication signCuboidSystem callComputer animation
20:34
HypermediaStack (abstract data type)GUI widgetView (database)Electronic mailing listAnalogyPrimitive (album)1 (number)Visualization (computer graphics)View (database)Electronic mailing listGame controllerMobile appHypermediaComputing platformMathematical optimizationSoftware developerData storage deviceCartesian coordinate systemWindowBitDifferent (Kate Ryan album)Menu (computing)Drop (liquid)Selectivity (electronic)Multiplication signWeb pageComputer configurationScaling (geometry)Contrast (vision)Staff (military)File formatComputer animation
22:42
Line (geometry)Execution unitLocal GroupSimultaneous localization and mappingComputer fileAttribute grammarPosition operatorLine (geometry)File formatComputer configurationDifferent (Kate Ryan album)Compilation albumView (database)Game controllerOnline helpWindowEndliche ModelltheorieModul <Software>Condition numberProduct (business)Element (mathematics)Software testingCartesian coordinate systemGraph coloringProjective planeMultiplication signLibrary (computing)Software developerCategory of beingSymbol tableComputer architectureWeb pageVisualization (computer graphics)Insertion lossSampling (statistics)MereologySoftware bugProcess (computing)Mobile appRight angleComputer animation
27:05
Local GroupComputer fileView (database)Social classWindowLibrary (computing)Open sourceCompilation albumCondition numberView (database)Portable communications deviceProjective planeUniverse (mathematics)Cartesian coordinate systemLogicBitLie groupVideo gameDifferent (Kate Ryan album)Social classComputing platformType theoryComputer animation
28:22
Local GroupWindows PhonePortable communications deviceWeb pageSystem callLink (knot theory)CASE <Informatik>Library (computing)Plug-in (computing)Compilation albumSocial classData storage deviceComputing platformCuboidComponent-based software engineeringFraction (mathematics)Condition numberInjektivitätFormal languageUniform resource locatorService (economics)QuicksortSampling (statistics)WindowProjective plane2 (number)Right angleMultiplication signCartesian coordinate systemForm (programming)Computer configurationDisk read-and-write headVisualization (computer graphics)Slide ruleData managementDigital photographyMenu (computing)Drop (liquid)Bit rateAddress spaceContext awarenessAutomatic differentiationWordTouchscreenInternet forumMobile appStack (abstract data type)Type theoryComputer fileCodeUniverse (mathematics)Computing platformRun time (program lifecycle phase)Video game consoleMultilaterationWeb 2.0RandomizationComputer iconDifferent (Kate Ryan album)Constructor (object-oriented programming)Pattern languageProof theoryEmulatorSource codeComputer animation
34:15
Component-based software engineeringRun time (program lifecycle phase)Wrapper (data mining)System callLine (geometry)ExistencePlug-in (computing)Programmable read-only memoryElectronic program guideComponent-based software engineeringService-oriented architectureCartesian coordinate systemBitProxy serverMultiplication signData storage deviceWindowWrapper (data mining)Run time (program lifecycle phase)System callComputer animation
35:04
Cursor (computers)WindowCartesian coordinate systemBitComponent-based software engineeringCursor (computers)Service-oriented architectureData storage deviceVisualization (computer graphics)Event horizonLine (geometry)Proxy serverEndliche ModelltheorieComputer configurationTerm (mathematics)Plug-in (computing)Process (computing)Position operatorSystem callProof theoryTemplate (C++)Insertion lossSet (mathematics)Structural loadDifferent (Kate Ryan album)Source codeComputer animation
37:08
Inclusion mapComputing platformComponent-based software engineeringMobile appView (database)LogicComputing platformSorting algorithmType theoryImage resolutionLatent heatPlastikkarteRevision controlFiber bundleImage registrationLanding pageConsistencyWeb pageLemma (mathematics)Computer configurationData storage deviceCartesian coordinate systemLink (knot theory)Projective planeLibrary (computing)Component-based software engineeringComputer fileAndroid (robot)outputWindowUniverse (mathematics)MathematicsComputing platformSoftware developerBitMultiplication signSocial classPortable communications deviceMachine visionArithmetic meanType theoryRevision controlFiber bundleMobile appDifferent (Kate Ryan album)Image registrationKey (cryptography)Point (geometry)Software frameworkImage resolutionStorage area networkPlastikkarteLanding pageTraffic reportingProcess (computing)GodScripting languageRing (mathematics)AreaSource codeComputer animation
40:28
Conic sectionCompilation albumConditional probabilityTemplate (C++)Library (computing)Component-based software engineeringExtension (kinesiology)Computer-generated imageryWindowPortable communications deviceRun time (program lifecycle phase)Cartesian coordinate systemComponent-based software engineeringMultiplication signProjective planePoint (geometry)FreewareDampingData managementPlug-in (computing)Video gameTemplate (C++)Library (computing)Service-oriented architectureComputer animation
41:47
Electronic mailing listPlug-in (computing)Condition numberProjective planeComputer configurationMenu (computing)Automatic differentiationBit rateControl flowLevel (video gaming)Electric generatorLibrary (computing)Compilation albumVisualization (computer graphics)Portable communications deviceComputer animation
42:27
Library (computing)Compilation albumConditional probabilityTemplate (C++)Component-based software engineeringExtension (kinesiology)EmailWindows PhoneSample (statistics)Absolute valueMultiplication signSampling (statistics)Game controllerCondition numberVisualization (computer graphics)WindowUniverse (mathematics)Level (video gaming)Mobile appDifferent (Kate Ryan album)Control flowCartesian coordinate systemBitComputer animation
44:33
Goodness of fitProjective planeWindowSpeech synthesisMenu (computing)Discounts and allowancesComputer programmingPlastikkarteData storage deviceDigital electronicsPay televisionSlide ruleBuildingFreewareBlogEmailWritingMultiplication signSoftware testingSource codeComputer animation
46:31
EmailWritingComputer animation
Transcript: English(auto-generated)
00:00
this small laptop and this little space here. Thank you for coming. I'm happy to see so many people are interested in Windows Store and Windows Phone. I was trying to come up with a really really good title for this session but I'm not a big fan of the sexy titles like why you completely suck if you don't watch my session type of titles.
00:20
So I just went with something somewhat boring what's new Windows Store and Windows Phone because I can't possibly cram into the title everything we're going to cover today. I changed my abstracts. I'm not sure how many have read the new abstract with a little bit more information. I submitted the abstract before build and I was NDA'd so I couldn't share exactly what I was going to talk about because a lot of it wasn't
00:43
official yet. Now it is so the abstract has been updated. We are going to talk about what's new in Windows Store and Windows Phone but also what is new surrounding those two technologies so we're not going to cover just that. I will not be focusing a lot on APIs and API changes. I will walk
01:02
through some of them but demonstrations are mostly centered around architecture, Windows runtime components, class libraries, universal apps and so on. I think that's where you gain most from actually watching a session because with APIs and so on you know you have the information
01:22
online, you have the documentation and you look it up when you need it. So this is, I wouldn't call it an architectural session, but there's a fair bit of that. My name is Iris Klassen. I'm a C Sharp MVP and a bunch of other titles. I'm a software developer for a company called IdentityMine in the US.
01:40
I live in Sweden though. I'm also a Pluralsight author and because of the density of this session, if we don't have time for questions at the end of the session, come up afterwards and you can also grab a free one-monthly pass for Pluralsight if you want to try the courses there. And I'm also an O'Reilly author and I have with me two books.
02:00
And the first two people to come up here and ask questions afterwards will get a copy of the book if they want to. It's for Windows Store, but hooray, now it applies for Windows Phone and I might have a chance of actually making some money off the book. Not really though, but okay. Usually you have one picture of yourself on the slide. I don't know why because usually they're in person.
02:21
But anyways, I have a lot of pictures. They updated the picture next to the abstract. I think it was yesterday. I changed my hair color a lot. So you might have seen me with something like this and I don't know what my hair is going to look like tomorrow. Let's talk about what we are going to cover in this session.
02:41
So I tried to group things a little bit together, but we're going to cover things that are related but still kind of differ a fair bit. So I'm going to try not to jump around too much, but I will need your full attention. I'm going to talk about conversions and sharing. We're going to talk about, when I talk about conversions,
03:01
I'm also going to talk about what's new in Windows Phone. We're going to talk about Silverlight, Windows Runtime, and also doing applications with JavaScript and HTML. I'm going to talk about universal applications. I will not spend a whole lot of time on universal applications because they are so simple that they don't need that. I'm going to talk about what's new in portable class libraries.
03:22
There were actually a few things that I didn't even see at a single session at Build. Somehow it went completely unnoticed that portable class libraries have had quite a few changes. And I think that's a shame because the team at Microsoft has done a fantastic job with the libraries. I'm going to briefly talk about the offering tools. Some new, some not so new, but it's good.
03:42
Some of them which are not new makes more sense to leverage today now that we have new sharing capabilities. I'm going to talk about components. Windows Runtime components, that is, with the most focus being on the new brokered components, which are components that allows us to use legacy DLLs
04:01
in a Windows Store application, which is really neat because finally we can actually have some decent line of business applications reusing DLLs. I'm going to talk about sideloading and also deployment, the store, the dev portal, and changes there because there's been a fair bit. And throughout the session, I'm going to recommend a couple of Visual Studio extensions that are good to have
04:23
and a little bit nice neat tricks. And at the end, I'm going to show you where you can go find a lot of samples for in particular universal applications. And that's where you're going to find all the examples of how to use the new APIs and so on. Let's talk about Windows Phone 8.1 Silverlight.
04:42
So Windows Phone now exists in many forms, and the Silverlight is still there and is not dead. TDD is not dead, Silverlight is not dead. It's still alive and somewhat thriving in the dark corners in the forest. We now have Cortana, which, Cortana, have anybody here tried Cortana?
05:01
Yeah? I live in Gothenburg, so asking for the weather always gives me Gotham, which is interesting. If I had Sweden at the end, she would actually tell me the weather. What's really neat about Cortana now, you still use the speech APIs exactly like you've done before, but it leverages more of a natural language, so you don't have to use grammar files
05:21
for the tiniest, tiniest little things. And that's why it makes a big improvement for us as developers, if you have applications that use speech. And I dare to say that so far we have the best speech recognition and text-to-speech among the mobile platforms, and I'm kind of hoping to see more improvements there as well. We now have a lot of triggers
05:41
and conditions in Windows Phone, and one of them is geofencing. And geofencing basically lets you set locations and trigger an action based on that location. We have roaming data between Windows Store and Windows Phone, which is quite neat, and this is something I've used
06:01
with Windows Store a lot. I'm very happy we have that in Windows Phone as well. It gives the user more of a feeling that it's the same application, although it's two different applications. We have also a start screen backup and app data backup on the OneDrive, and this does not come out of the user's OneDrive, what do you call it, capacity.
06:22
It's not a lot that it takes anyway. We have so many new tile templates, but most important, we have a custom tile helper class which lets us create tiles any way we want to. They're really pushing forward tiles. Applications never close them back. That's quite important to know, and it's also important to know
06:41
that when you launch an application from a tile now, it doesn't start a new version of the application. It launches the same application that was there before. So that's quite important to know. We have the Action Center, and the Action Center has significance for us as developers because in the Action Center
07:01
we can have our notifications, and this brings me to that we now have a common notification service. So you only need to create that one channel to target both Windows Store and Windows Phone. And the memory management has been improved and is now dynamic. So in very dense, this is kind of what's new in Silverlight.
07:21
Although there's been a lot of convergence and a lot of talk about now we have everything on both platforms and so on, there are a few things that we only have in Silverlight which we don't have in WinRT. So what we have in Silverlight for Windows Phone, which you might take into consideration if you're starting a new project today, if you want to use
07:41
lenses support, if you want to use the clipboard APIs, camera capture tasks, green tone provider, search extra, screen lock, lock screen wallpaper API, and a few more. There's a list on MSDN. Take a look there, because if you have an application that relies on one of these, you might want to wait with updating the application.
08:01
The biggest change for me at least personally hasn't been all this, because you know, having new additions, having new APIs, it's not something I kind of expect. This is however for me the really big news, all the options that we have. It's a little bit overwhelming. If you were to open this today,
08:21
it's the first time you're doing Windows Phone application. You have all these options. It'll be really hard to kind of select something. This reminds me before like when you want to start a new web application and you had all the options. I'm kind of expecting to see just the one store option there at the top, and then you can download templates what you need.
08:40
We have a lot of options to choose between. I'm going to show you in Visual Studio here. Let me tab out. For some reason, the computer keeps jumping out of duplicate mode every time I end the slide show.
09:01
I'm not going to do any file new project. I assume everybody knows how to do that. I want to show you three examples here. I hope you can see on the right hand side. It's a Windows Phone application. You can still develop for all the Windows Phone platforms. If you're targeting Windows Phone 8, it's going to look like before.
09:20
If you target Windows Phone 8.1, there is one difference that you will notice that we now have a package app APEX manifest there. We still also have the old manifest file which you see here, but we have this in addition. So the one at the top is the Windows Phone Silverlight. The one in the middle is Windows Phone Silverlight 8.1. And the one at the bottom
09:41
is Windows Phone WinRT 8.1. And as you can see, it only has an APEX manifest. You can see a transition here that here at this point you have both and then in the WinRT version you only have the manifest. And it's kind of where they're heading with Windows Phone as well. While we still have
10:00
support for Silverlight, it was quite clear that it's just for buying us time. At some point there will not be further support for Windows Phone Silverlight. So you might want to get used to the thought that you have to transition over to the new XAML stack, the common XAML UI.
10:21
So these were some of the options. I'm going to get back to some of the other Windows Phone projects that we have. But I just wanted to show those first. Let me go back to the slide here. Keeps jumping out of presentation mode, sorry.
10:46
This is something that came with the update and is literally driving me insane. All right. So two other things that we have, one other thing that we have in Windows Phone now is we can finally create
11:00
HTML and JavaScript applications within this phone using language projections, which means that you have full access to the same APIs as if you were writing it in C Sharp. Now, this is not the same thing as the previous HTML template, which was with Silverlight, which was basically just a browser control. I personally never even used that
11:20
because if I wanted to use that, I would just go ahead and just use PhoneGap, for example, which I really don't want to use. What's really neat about HTML and JavaScript applications is that we can leverage third-party libraries, and I wanted to try this. I'm not very much a JavaScript developer, but I had the pleasure of attending Mr. Scott Allen's workshop on AngularJS
11:41
earlier this week, and we were given a choice between ASP.NET, MVC, or Node to go through the labs, and I decided on doing Windows Phone instead and see how that would work. Now, since this is on mobile phones, naturally there are going to be some differences, and that also means that you have to do
12:00
a little bit of tweaking, so I had to do some changes to Angular to make it work, but not as much as I thought I would need to. I'm going to show you how it looks like. I'll have to keep doing this all the time. This is going to...
12:20
Does anybody know why it does that? I've tried it on three different computers, and it keeps jumping out of presentation mode. Let me go to the application here and close this. So, yeah.
12:45
Yeah, it's all tabs. It goes out of... Yeah, it's still... It's, yeah. It is what it is. I don't have a lot of slides, thankfully, so I have a lot of code to walk through, and actually, I'm going to close down this
13:00
because I don't want you guys to be distracted by this. Okay. Back again in Solution Explorer. This project called Not The Same. This is the old HTML template, and it's basically, it is a Silverlight application with a browser control. Now we have, I guess we can call this native HTML and JavaScript,
13:22
and here is the application. Let's see if I can make this run. Okay. Let's see if that's the right emulator. My emulator image got corrupted in the update I did last night,
13:41
so I would probably hold off on that update, but the application should work. So this is the application, the result of the lab. It's just, it's not anything fancy, but it does prove that you actually can use Angular. Very simple application, just you see all the different movies, and you can increase
14:01
or decrease the rating. You can edit. There's, let's see, there's validation, and sorting, filtering, searching, and so on. To be able to make this to work, I added the AngularJS,
14:21
and I had to do some patching because in WinJS, you don't, it's not allowed to use, to load dynamic content, and I'll show you quickly what I had to change there in the shared project here.
14:47
So this is a function you have in JavaScript. Let me scroll in here. Execute unsafe local function. So when it complains about loading dynamic data, you have to just wrap it in this function. I'm not sure if I would use this
15:01
in a production application, patching up Angular, because you might forget to patch a new update. So there are other ways to go about it as well, but I just wanted to show you that you can use any third-party library that you want, but be aware that this is not a web application, so therefore, you will need to add some modifications. But it does make it easier if you want to reuse
15:21
something that you already have. As you might have already noticed, I'm actually in a shared project, which I'm going to talk about really soon, which is related to universal applications. What I have here, I could share it across to a Windows Store application, which brings me back to the slides,
15:40
and let's see if it jumps out again. Yeah, sure. Just a moment here.
16:03
Yep, slide show. I will say, I decided to primary monitor, because I wonder if that's going to help as well. Well, we'll see.
16:20
Thank you, Scott. Is that what I get for promoting your workshops? Universal applications. It's just a new solution template that really simplifies the way that we can share code. Think linked files. If you have linked files, it's what we're doing. Apps can share code, and they can share views.
16:41
In regards to views, we use the common XAML UI. Windows Phone now has a project type which does use Windows Runtime, and also uses the new XAML stack. And of the controls, you have 80% that is in common, and 20% that is adapted which means that they have a slightly different behavior,
17:01
slightly different look, but they still use the same underlying APIs. And the reason that there were always going to be some differences is because the user expects different things, because there's a big difference between a tablet and a phone. Maybe not so much this phone, because it's quite big, but different user expectations depending on the device.
17:22
I'm going to show you an example to see if this works. Ooh, it might actually be working. I'm going to go out of the universe application. I'm going to show you instead. As I say, I'm going to skip the File, New Project. Let's just File, Add, New Project, and then you will find, under Store Apps, you will find Universal Applications.
17:41
Let's have a look at Universal Applications. When you create a new Universal Application, you get three projects. You get the Windows Store, a Windows Phone, and a Shared Project. With time, we will have Xbox as well, but not quite available to us yet. The Shared Project, I guess you can just call this a virtual folder
18:01
where you have everything that is being shared. As you can see, I am sharing both the startup page and also the main page of the application, which you can do, but I think you're going to find yourself having a problem having a layout that's going to scale just as fine to this size of a screen to this size of a screen
18:20
to an even tinier screen. Usually, you're not going to end up sharing whole pages. You're going to end up sharing user controls. Let me open this and show it to you. And I want to point out also that you can see on the references here that the Shared Project
18:41
is referenced from both the Windows Phone and also from the Windows Store. But that's not so important right now. I have a very simple application. It just says Hello World. We can stick with Hello World for now because we just want to see the interaction between the different components. This is just a very,
19:00
very simple text block there and then I just pass in Hello World. I'm going to show you something in two seconds. I'm going to show you how you can share code in different ways. This is how you can do it in a universal application. I have my code file and as you can see, I'm using conditional compilation.
19:21
If you don't know what that is, it's basically just telling the compiler what to compile based on a symbol. This is a symbol, and this is a symbol. If you wonder where they are, just right-click on a project, you go to Properties, you go to Build, and then you have conditional compilation symbol and you see them here. As long as you use a semicolon
19:40
to separate them, you can add your own. I would, however, prefer to stick to the existing ones so another developer looking at your code knows what on earth you're doing. Conditional compilation, although it's really, really ugly, it does work quite neatly and as you can see, we have really good IntelliSense support. It is only highlighting with my beautiful syntax
20:01
highlighting there. I love the colors, yes I do. It only highlights the application that we're actually working from, which brings me on to talking about offering tools, which we'll do very, very soon. But this is how we can choose to output different things depending on which platform
20:21
we are filing from. It's a simple example, but it does scale pretty well as well. Let's go back to... And this is it with Universal Applications. I'm going to show you a little bit how you manage the views. Let me just... So in short, with the common XAML UI,
20:40
talked about the ones that are in common and the ones that are optimized, referred to as primitives or tailored slash optimized. So the controls that are optimized, the list view, flyout, media player, and the app bar, command bar. Now, offering improvements in Visual Studio. When you are targeting
21:01
two platforms that are as different as they are, you got to manage the design as well. Although I don't really like working a lot with design, I found myself that as long as I'm doing XAML development, I always end up doing full stack development. It's very rare I've actually had a designer available to me. We have much better
21:20
tooling support than we've had before. And I can illustrate that by going to the main page here and show you this. It's a little bit hard to see. Zoom it. Do not have it installed right now. But you have a drop down menu and you can select Windows Phone or just the Windows Store application and whatever other platforms you have targeted
21:41
and it will switch between them. It works 90% of the time for me. Sometimes it kind of lags a little bit. But you can easily switch here. And when I do that, as you can see, it switches here in the designer as well. And the device window has also been polished a little bit. To find the device window,
22:02
it's easiest just to hit control Q and it brings up the quick launch menu at the top and start typing device and you're going to see it as an option. So the device window is going to let us see without actually running the application how it's going to look in different scaling, different contrast,
22:20
different themes, and so on. And as long as you use the navigation menu and switch between Windows Phone and Windows Store, you can do a lot of editing without having to run the application, which we know takes a lot of time. We also have other navigation menus here to find things.
22:40
Talking about that, I wanted to mention a little thing, which I am not going to show now, but I have gotten this question a few times. How do you format XAML? Because you're going to end up with a lot of XAML now. If you want to format XAML, there's actually an option you can set to auto-format XAML, and we've had that around for about four years, I believe.
23:01
It's just well hidden. So you go in options and under XAML, position each attribute on a separate line. So take that and you'll be able to. Let's talk about how we manage differences in the view. Because managing the differences
23:21
between... In code, you can use conditional compilation, which I showed you here. But how do we actually do with the view? Well, there are a few ways we can go about it. I'd like to show you something here. Be aware that what I'm showing you here is it hasn't been tested a lot. It's still in beta. So if you use it,
23:41
use it with care. There's a developer, the same developer that made XAML Spy, with XAML Spy, which I'm going to demonstrate. He's also made a nice little NuGet package, which allows us to do conditional compilation in XAML, which is quite neat. The way it works after you add it,
24:00
it's called the XAML Conditional Compilation, XCC. You define the symbols at the top, pretty much, kind of as we do in C sharp. And then you just wrap the elements that you want to use using them. There were a few bugs, which I notified him about, I think,
24:21
two days ago, and he fixed it within 20 minutes. He seems very keen on keeping this project up to date. It's definitely worth a try, but be very careful bringing this into a production application without having some decent testing and making sure that it won't break. That is one way you can go about it. You want to have everything in there.
24:40
What you can also do is if you have the exact same user control, as you can see here, I have a child user control, which is this one here. If I switch to Windows Phone, let's give it some time to load, it should bring up the Windows Phone one, which is a different color. As long as you use a control in XAML
25:01
and it exists in both the projects, and it will let you know if it doesn't exist in both projects, we get really good help here from Visual Studio, it will bring in the right one. So it's very easy to actually handle the user controls. And I think a modular model or architecture of the application is something that is
25:20
easier to manage than actually managing whole pages at the time. Because you can share user controls more that you can share pages, because of just the scaling basically. And XAML Spy, I'll show you XAML Spy here, let's see. I'll run the emulator, see if I...
25:46
I can't run XAML Spy on the JavaScript application yet, he might though add support for that later. I'll use... This is just a hub application, I haven't made this one.
26:04
All right. Let's see, select Visual. So this is XAML Spy. What it allows you to do is basically debug XAML at runtime,
26:21
and it's helped me a lot in particular when I've been working with animations, and I just find working with animations a tremendous pain. If you purchase a license for it, you can actually run just a Zap package if you want to, otherwise you can run it from Visual Studio like I did now in the emulator,
26:41
and we'll bring up a window here and you can go and take a look at all the different properties that you have for an element. For some reason, they're not all showing up here, are they? Let's see. That's interesting. Well, it seems to actually have problems
27:01
loading the XAML stack, so how's that for debugging? That is XAML Spy, and this is not a session about XAML Spy, and it's definitely not a new edition here for Windows Phone. Portable class libraries. We've been talking a little bit about sharing logic, and I do find that,
27:21
in particular, portable class libraries kind of go very much unnoticed, and I'm not quite sure why. Not everybody likes them. I really like them. If you don't know what portable class libraries is just a magical type of library that creates one binary which is then shared, which also means that we can't use conditional compilation, and we need to abstract away
27:41
the platform differences, which some people, like me, prefer over conditional compilation. There has been great improvements now that we can actually share views, assets, and resources in a portable class library, and there are also more and more third-party, open-source projects that support portable class libraries, and there's a NuGet package
28:01
for pretty much everything. It works really well together with universal applications and the shared project that universal application uses, but to be able to use that, you need to have an extension. I'm just going to pin this back.
28:34
This is an extension you want to have if you want to be able to use the shared project in any other way
28:43
than doing the create new universal application. You will need to add this visual studio extension. I think it was released a few days after build, but I did mention it at build. This is the shared project reference manager. At the end of this session, I have a slide with the screenshots of the visual studio extensions and tool I'm talking about if you want to kind of grab
29:01
a photo as a reminder for later. This also allows us to use the shared project together with the WPF application, console application of Windows forms, web forms, whatever you want to use it for. However, of course, you're not going to be able to share the WinRT XAML stack with anything else than the actual applications that support that
29:21
particular XAML stack, but make sure that you download this one. Otherwise, you're going to bang your head against the wall trying to add other project types. I assume that with the time that will be included in a visual studio update. I assume. I hope so. Let's talk about portable class libraries.
29:41
As we do that, I'd like to talk about generally how we've been sharing code before we had universal applications, because we've been able to share code for a long time, and many people are under the impression that this is something new, and it's super cool. Of course, it is cool that we have universal applications, but it's just an extension
30:01
of something we've already been doing for a long time, and it's important that people understand that. There are a few ways you can share code. If you want to be really cheeky and maybe not super smart, you can go ahead and just copy a file over to the other project. It's not really sharing. It's kind of inspiration by copying. But a lot of things
30:21
can go wrong there when you copy and paste, so it's not something we usually recommend. The next step from that would be to create a file somewhere in the solution, in the project or wherever, and then you add it as a link to the project, which you do by right-clicking, add existing item, you select an item,
30:41
I just add something random here, and in the drop-down menu, you select add as link instead of add. This will, in the project file, link in the file, so it's going to seem like it's physically there, and it has a tiny, tiny blue icon that indicates to us that this file is being linked in. This is what universal applications also do, but it's not visualized
31:02
the same way. After linked files, we got portable class libraries, and we had a lot of problems with portable class libraries in the beginning, because there was a lot lacking. Portable class libraries can be used to target many, many different platforms. WPF, console applications, whatever you want to target,
31:22
but it's going to limit access to APIs to the least common denominator, so if you're targeting, for example, Xbox today, you're going to be very limited in what is accessible to you. That is kind of the downside of portable class libraries. You have to handle platform differences without conditional compilation,
31:42
which is, you know, you use, for example, a constructor injection, use a service locator, you just use some sort of nice little pattern to manage it. So I probably wouldn't do exactly that. I use service locator with adapters, but that's a different story. Now we can actually
32:00
share XAML as well, and the only reason that we can share XAML now is because we now have the same XAML stack available to us, both Windows Store and Windows Phone, and soon Xbox as well. So I'm going to show, run this example here. Just going to set the startup projects here.
32:20
Let's see, those two. So I can run both at the same time, just as a proof of concept. Right. So as you can see, hello from Windows Phone, hello from Windows Store, and there's a button that takes me to a yellow page, and this page is in the portable class library,
32:40
and I can go back. It works. So that was one option. So we have the portable class libraries. A third way that we can share code today is by using Windows runtime components. Now, Windows runtime components we've had for a while as well, as long as we've had Windows runtime,
33:00
we've had the components as well. They're very limiting, and there are many things you can do in KANA too with the runtime components. There's a course on Pluralsight about that, if you're more interested about it. So this would be my least favorite options out of the sharing options. What's really nice about the Windows runtime components is that it's cross language. It's Windows runtime,
33:21
it leverages metadata, so you can write it in any language available to the component to be written in, and you can call it from any language that is available to call it from. For example, a JavaScript phone application, which I have here. And I'm not going to run it, but I'm just going to show it here to you. So you create the Windows runtime component,
33:41
you create whatever method class or whatever you want to do, and then inside the JavaScript application, after we add a reference to the component, you just call it. It will go ahead and lowercase the methods for you, so you don't need to change your naming conventions. If you write in C sharp, you just write as you usually would, and you would probably not lowercase a method name.
34:03
Trust me, it works. I don't want to run it on the emulator. I'll show you another example where I actually do that. These are the runtime components. Which brings me to the brokered components. They also introduced brokered components at build,
34:21
which was really exciting to me, because this has been a little bit of a deal breaker with Windows store applications, that you can't use legacy DLLs. The thing is, what do you do if you actually want to call some native DLLs, and you want to have them accessible to you in a Windows store application? What you can do now is you can create a Windows runtime component
34:40
that uses a proxy, which allows you to call legacy DLLs or other DLLs. As long as you provide a wrapper for a native DLL inside the Windows runtime component, you can actually use it. Which means that a lot of companies can actually leverage existing DLLs.
35:01
I'll show you a quick example here. Here's an example of a brokered component that I put together. As you can see, I'm calling some native Windows DLLs. Here is the proxy. It's written in C++. I didn't write it. I'd rather not try to. There's a nice step-by-step
35:20
guide, and I missed the end, which I hope they've updated, because if you follow the steps, it's not going to work. It took a lot of messing around to actually manage to get this work. It's a little bit tedious to make it work, but it might be really, really important for business applications. There is a Visual Studio extension for brokered components, which gives you some templating,
35:43
but I believe you still need to generate the proxy yourself by adding a post-build event. The broker here basically just lets us dig into these DLLs and call them. In the Windows Store application,
36:03
you need to add an extension here to allow the call to the brokered component, as you can see I've added here. You have to sideload an application that does this. Because of the sandboxing model of Windows Store applications, they weren't kind of giving us
36:20
the option of doing this with WinRT components, but now we can, but it means that the application has to be sideloaded. It gives us all the possibilities in the world. We can actually do whatever we want to do now, as long as the application is sideloaded. With sideloading of Windows Store applications, it has been a little bit simplified. It's much cheaper now in terms of the licensing and so on.
36:42
There's been a lot of improvements there, and I believe they're still improving on the sideloading process of Windows Store applications. Let me run this application. This just sets the cursor position and plays the sound. You probably won't hear the sound. See if you can see the cursor move. It moved to the left there.
37:01
It's just a proof of concept. Wouldn't exactly call this a line of business application, but yeah. With all those options that we have available to us, and the brokered components are just for Windows Store applications, with all those options available to us, the natural question is, what do I choose?
37:21
You can see here that the linked files in the shared project are really similar, because basically it's more or less the same thing. I would tend to use the shared project in universal applications in most scenarios, together with a portable class library, if I aim to target other platforms such as iOS and Android.
37:41
Portable class libraries work really well with Xamarin, and you can target iOS and Android as well. My manager, Lauren Bunioni, has an MVVM framework, MVVM Lite, that now works really well with Xamarin as well. The WinRT component, as you can see, is quite, quite limiting,
38:02
so think it through before you decide on actually using that one. Let's talk about deployment, because I started talking a little bit about deployment, but I want to talk a little bit more about that. Packaging has also changed for applications. Now, there are three different package types
38:22
for 8.1. You have the Zap packages, you have the Apex, and you have the Apex bundle. In regards to resolutions and resources, just chuck it all in there, because only what the user needs on their device is going to be downloaded, that's fine. Applications can now be installed on SD cards, woohoo, but users can opt out,
38:41
it's not something that we can decide. If we are however worried that the user is going to go ahead and share our application, they're not going to be able to do that, because it's encrypted with a device-specific key. And the question often comes up, can you add lower version support later on? Yes, indeed you can.
39:00
There are all these changes to packaging. There's also a lot of changes to the store and also to the developer portal. They have this grand vision of having one store, which I think we all are looking forward to, one landing page, one registration and so on. I'm not quite sure when that's going to happen, but that is the aim. And that also means
39:21
that we have a lot of changes in the dev center as well. Today, when you want to publish an application, a universal application, you have to link the two together, so you need to reserve a name for both the two applications. That's quite important to know. You still upload the packages separately. It's still kind of two separate processes
39:40
today to publish. The dev center, you can now actually cancel submissions. There's much faster publishing. I hear people who get applications published within a day, which is really nice. There's better reporting. In the Windows dev center, you can unpublish applications. You've been able to do that for a while.
40:00
It's not really that new, because I know I've done it a few times. I join a hackathon, I whip out some apps to win something, then I remove it from the store later, because I'm embarrassed. And you can set the publication date and time, doesn't mean that the publication is going to happen any faster. It's not like I'm going to see the time and date, and go like, oh my god, this person is in a hurry,
40:20
better get this out. That's not going to happen. I realized that there was one thing I didn't show you. When I showed you the JavaScript application that I wrote with Angular, we were also using the Windows runtime component.
40:42
When you use a Windows runtime component, it's all packaged together. I had this question the other day, how that works. Now it's all packaged together, but you can make a Windows runtime component portable. I've never done that myself, but you can if you want to.
41:03
So these are some of the extensions and tools that I showed you. So these are the three I would get. This is alternative. This actually worked quite well for me up until today, so I'm not quite sure what happened there. But make sure that you grab the Brokered WinRT component project template, because you are going to need that.
41:22
If you want to do Brokered components, because you don't want to write them from scratch, you're also going to need to keep an eye on the documentation for the Brokered component. The shared project reference manager allows you to use the shared project freely without the restrictions of going new to universal application and get the shared project like that.
41:43
And to add a reference to a shared project, let's do that. Give me a portable class library here. Let's see. Oh, this menu is so big. It's just driving me crazy.
42:02
Let's see. Add. There. Without the Visual Studio extension, you're not going to see this option there where you add the shared project. So you're not going to find it under add reference and then you find it in the list. It's going to be under the add menu,
42:21
add shared project reference. Conditional compilation, it's still kind of an experimental stage. It works. I'm not sure how bad breaking can be. The problem I found with it that it was generating XAML and it was having merge problems
42:42
generated with XAML that was generated, which can actually be quite serious problem. So be a little bit careful with it, but definitely a very interesting concept. Otherwise, just use different user controls. It's a little bit more work, but we can still do it.
43:01
Now, one more thing. If you really want to take out the Universal Windows applications and you also want to see how to use all the new APIs and so on, there is the Universal Windows app samples, which just gives you a lot of different samples that you can go through. I have them here. I'm not going to open each and one of them and go through them, but you have a sample for basically any API
43:22
that you might be interested in taking a look at. There are many samples on MSDN, so make sure that you take a look at them. And with that said, I think I was so worried that I wouldn't have time to go through everything that I was going to show,
43:42
that I believe that I'm going to be able to answer questions. I believe so. So I'd gladly take some questions now if you have some. Yes? Yeah.
44:02
No, it's automatic. Yeah. And it's not something that we can decide on. This is something from the user side. Questions, yes? Yeah, absolutely.
44:20
The reason why I didn't bring up Blend now, I actually only use Blend for animations and also sometimes when I work with behaviors, because in Visual Studio now, we have more or less almost all the Blend capabilities inside the designer, because it is basically Blend built into Visual Studio. Blend very much, so good support,
44:41
and everything I've shown here with the device window and the navigation menu and everything, you will also find in Blend. Yeah. I have not tried that, so I actually don't have an answer to that.
45:06
There isn't any... I wouldn't say there's any one way to go, but it really depends on your preference.
45:22
Excuse me? I have actually not tested Cortana yet, as far as I know from everything that I've seen, I haven't been working with any project with Speech after build, but I did watch the sessions they had on it,
45:40
and from what I saw, the examples are still the same, it's just an improvement on what we get out of it, but I didn't see that we had any extra access or capabilities beyond what we've had from the previous release. I can however be wrong. I have to admit that in particular with Speech, I am not 100% up to date with Cortana.
46:04
Any more questions? It's a quiet crowd. All right. If the first two people coming up here interested in programming for Windows Store applications, we'll get a book, and if you'd like to buy the book, discount the price, I have cards here, and Pluralsight monthly subscription,
46:22
free, full access, unlimited here as well. And feel free to ping me on Twitter, and as it's on the slide, I don't provide my email, I've gotten some really weird emails, so since this is recorded, I'd rather not have my email on the slide, but write in a comment on my blog,
46:41
or just tweet to me, and I'll give you my email. Okay. Thank you.