As you can see from the earlier WinRT diagram (see Figure 23.7), another benefit of having WinRT in the picture is that you are no longer limited to your typical stable of managed code languages. So although you could develop your application C# or Visual Basic, all the WinRT objects are also available to JavaScript/HTML and C++ code. This widens the playing field quite a bit. There are no second-class citizens in the equation: WinRT is an equal-opportunity API. As a developer, you are free to concentrate on the toolset that you feel most comfortable with from a skill set and background perspective. The tooling and the API are there to support you.
With WinRT, you can develop a Modern UI application using DirectX, HTML/JavaScript/CSS, C#, Visual Basic, or C++. Each language will have a set of common and a set of unique project types.
For developers coming from the web side of the business, Hypertext Markup Language (HTML), JavaScript, and Cascading Style Sheets (CSS) are familiar and capable technologies. Building a WinRT application using these languages results in a structure that is similar, if not identical, to a website/application:
CSS is used for the presentation (that is, the layout and styling of the user interface).
JavaScript is used to code the behavior (the way the app handles interactions, events, business rules, and so on).
HTML is used for the structure of the content within the UI.
To create a JavaScript application, click File, New Project, and then locate the JavaScript language selection to the left (see Figure 23.8).
Note that there are five selections to choose from, as described in Table 23.1.
Figure 23.9 shows the default project structure for an HTML/JavaScript application.
Developers more familiar with WPF or Silverlight will benefit from using the XAML with C# or Visual Basic project templates, with this choice:
XAML styles are used for the presentation.
C# or Visual Basic is used to code the behavior.
XAML is used for the structure of the content within the UI.
To create a XAML application, click File, New Project, and then locate the C# or Visual Basic language selection to the left (see Figure 23.10); then select Windows, and then Windows 8.
With C# XAML projects, note that there are four primary UI project selections to choose from, as described in Table 23.2.