WinRT versus Win32 on Windows 8

The Windows Runtime API (WinRT) replaces the old Win32 libraries for accessing operating system functions. The WinRT API is object oriented, largely asynchronous, and callable easily by a wide variety of programming languages. Win32 continues to be supported by Windows 8, and it is what enables all existing Windows 7 applications to function in the Windows 8 desktop environment. The following figure shows how existing technologies map to the Windows 8 development platform.

 

 

 

 

 

 

 

 

Windows 8 Development Strategy

When considering the impact of Windows 8 on future software development, the following broad strategies should be evaluated:

1- Continue to use existing technologies, and run the application in the desktop environment.

2- Create a WinRT/Metro style smart client application that takes full advantage of the new WinRT and Windows 8 features.

3- Create a browser-based web application that relies on no plug-ins, so it can run in the browser in both the WinRT and desktop environments.

In summary, the new WinRT API and Metro style applications may represent the future of smart client development on the Windows operating system. Existing applications will continue to run in the Windows 8 desktop environment. Additionally, existing web applications that avoid the use of plug-ins will run in the WinRT web browser.
Existing developer skills in XAML, C#, VB, .NET, and Silverlight carry forward to WinRT development. The same is true for HTML5, CSS, and JavaScript developer skills.

Metro Style App Development Useful Links

Metro Style App Development Useful Links

Metro style apps are designed to leverage special hardware capabilities and context information to create an experience that is tailored for the user. For example, an app that uses sensors to determine your location, delivering content appropriate to that context, while also using an ambient light sensor to adjust the brightness level of the screen. Metro style apps are built using your existing skills and can reuse code assets you already have. If you know web development technologies, you can use HTML5, CSS3, and JavaScript. Or, you can use more traditional programming techniques.

The following links are useful to learn the Metro Style programing model:

1-    Metro Style App Development Official Website

http://msdn.microsoft.com/en-us/library/windows/apps/

2-    Tools for Metro style app development

http://msdn.microsoft.com/en-us/library/windows/apps/br211374%28v=VS.85%29.aspx

3-    Videos of How to Create Metro Style Apps

http://channel9.msdn.com/Events/Build/Build2011

4-    Samples of Metro Style Apps

http://code.msdn.microsoft.com/windowsapps

From C# Learners

5-    Metro Style Apps

https://csharplearners.com/category/metro-style-apps/

From MSDN

6-    Metro Style Apps – Walkthroughs

http://msdn.microsoft.com/en-us/library/windows/apps/hh464943.aspx

http://msdn.microsoft.com/en-us/library/hh440545%28v=vs.110%29.aspx

From Code Project

7-    Metro Style Apps

http://www.codeproject.com/KB/WPF/WpfMetro.aspx

http://www.codeproject.com/KB/gadgets/MetroPuzzle.aspx

http://www.codeproject.com/KB/WinRT/MetroStyleToggleW8DevPre.aspx

http://www.codeproject.com/KB/WinRT/AddAppBarXAMLMetroApp.aspx

http://www.codeproject.com/KB/ThirdParty-Reviews/metroimageprocessing.aspx

http://www.codeproject.com/Articles/269351/WinRT-Transitions-Creating-Fast-and-Fluid-Metro-UI.aspx

http://www.codeproject.com/Articles/255730/TweetSearch-A-Cross-platform-Metro-UI-WinRT-and-Si.aspx

From C# Corners

8-    Major characteristics of UI of the Metro style apps

http://www.c-sharpcorner.com/Blogs/7148/what-makes-an-app-a-metro-style-app.aspx

From CodePlex

9-    Metro Applications

http://8metro.codeplex.com/

10-   MP2 Metro

http://mp2metro.codeplex.com/

11-   Metro Pandora

http://metropandora.codeplex.com/

Scott Hanselman on Visual Studio 2011 in Tech.Days 2011

On November 15, 2011, Scott Hanselman presented in Tech.Days 2011 the highlights of the editor of Visual Studio 2011 Developer Preview, as well as a few of his own insights about new features in Windows 8, HTML5, Windows Phone, ASP.NET, MVC, and SignalR.


 

 

 

 

 

 

 

 

 

 

Visual Studio 2011 New Editor Features

1- CSS Color Picker
The background color property comes with the color picker popup.

 

 

 

 

 

 

 

 

 

2- Region Block
Region block can be created in the CSS editor.

 

 

 

 

 

 

 

 

3- Extract to User Control
In the HTML editor you have an option called “Extract to User Control” that allows you to refactor your code and put the selected code in a user control.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Comments:

Scott Hanselman: Great post!

What are Metro style apps?

Metro Style Apps
Metro style apps are full screen apps tailored to your users’ needs, tailored to the device they run on, tailored for touch interaction, and tailored to the Windows user interface. Windows helps you interact with your users, and your users interact with your app. R

Your choice of programming languages
You can create your app in the languages you’re most comfortable with: JavaScript with HTML5 and CSS3, or C++/C#/VB with XAML.

New deployment method
Your users can safely and simply install your apps. Removal is just as safe and simple, and won’t lead to degradation of system performance over time.
1- Metro style app packaging: You package your apps for deployment as Metro style app packages. With Metro style apps, all apps are installed per user; they install, update, and uninstall cleanly; and they don’t change the operating system in an irreversible way.
2- Windows Store (not yet released)

New UI and touch-centered input
You can create apps with controls that put your users’ goals first, that support direct manipulation of UI elements.

Localization
You can develop your app once and deploy in multiple locales and multiple languages. Not only that, Windows Developer Preview provides an API that ensures your app responds to users’ language and cultural preferences—like date, time, number, and currency formats—with little to no effort on your part. The end result is a great app with a coherent cultural experience tailored to each user and to all users everywhere. Learn more about Globalizing your app.

Developer tools
With free versions of Microsoft Expression Blend and Microsoft Visual Studio 11 Express for Windows Developer Preview, you get a development environment and templates that help you design, develop, package, debug, and deploy your app.

Reverse Engineering C# and XAML Win8 apps

This post has been removed. Please email [email protected] if you have any questions.

ASP.NET 4.5 and HTML5

ASP.NET 4.5 includes the following new features and enhancements:

Editor
1-      HTML Editor
2-      Page Inspector
3-      CSS Editor
4-      JavaScript Editor

Core Services
1-      Asynchronously reading and writing HTTP requests and responses
2-      Support for reading unvalidated request data when request validation is enabled
3-      Support for WebSockets protocol
4-      Bundling and minification of client scripts
5-      Support for asynchronous HTTP modules and HTTP handlers
6-      Integrated Anti-XSS encoding routines

Web Forms
1-      Support for HTML5 form types
2-      HTML encoded data-binding expressions
3-      Unobtrusive JavaScript for client-side validation
4-      Model binders
5-      Strongly typed binding expressions in data controls
6-      Fallback support for content distribution networks (CDNs) in the ScriptManager control
7-      Improved paging in the GridView control

ASP.NET MVC 4.0
1-      ASP.NET MVC 4 Release Notes
2-      Using the HTML5 and jQuery UI Datepicker Popup Calendar with ASP.NET MVC
3-      ASP.NET MVC 4 Mobile Features

ASP.NET Web Pages 2.0
1-      New and enhanced site templates
2-      Validation
3-      Script management for complex scripts
4-      Side-by-side support
5-      Membership and authentication
6-      Mobile display modes

Justin Angel on Silverlight 5

Possible features of Silverlight 5:

1- More Platform Reach

When talking about “reach” there are a few interesting dimensions:

a) Silverlight Browser Support: Silverlight currently only officially supports Internet Explorer, FireFox, Chrome and Safari. Support could be extended to Opera or other less prominent browsers.

b) Operating System: Silverlight is currently limited in the Mobile space (No Symbian support yet) and in the Gaming Console space.

c) CPU Architecture: Silverlight doesn’t support x64 CPUs, Mac G4 PowerBook CPUs, and a few other CPU architectures.

2- Bundle Silverlight with Windows

At Mix10 Microsoft VP Scott Guthrie announced Silverlight Adoption rate is at 60% of all internet connected machines.
In the future, we could hope to see Microsoft bundle Silverlight with Windows or add it as a super-duper-should-have update to Windows Machines.

3- Improved WriteableBitmap API

The in-memory drawing API in Silverlight is somewhat limited for advanced tasks, like:

1) No API for Drawing Shapes.
2) No API for Resizing & Rescaling.
3) No API for Clear, Copy & Crop methods.
4) No API for Conversion to various formats.
5) Performance issues that plague any “1 pixel, 1 read/write” approach.

4- 3D support

5- Store File Permissions Granted by the User

Using the OpenFileDialog and SaveFileDialog end-users can respectively grant read and write permissions for any file to a Silverlight Application.
Developers would like to see these permissions persist after the application has been restarted. We can see in Silverlight 4 RTM that Full Screen, Webcam and Clipboard access already get persisted after application restart.
So it is not unreasonable to hope this feature will be included in Silverlight.

6- Add PLINQ and TPL support

With PLINQ & TPL creating, debugging and maintaining multi core applications has been massively simplified on the .Net framework. With Silverlight supporting C# 4 and a majority on new .Net 4.0 features, it is possible we’ll see PLINQ and TPL in future Silverlight versions. That would allow Silverlight to have the best in-browser threading  solution for any major programming platform.

7- Reporting Controls and SQL Reporting Services Integration

Microsoft has a great suite of Reporting and Analysis tools that are part of the SQL Server 2008 product group. As part of ASP.Net and winforms there are ReportViewer controls that allow to view, zoom, page and export from predefined RDLS reports. If this feature is implemented it would probably include a new Silverlight & WPF Report Viewer control as well as deep SQL Server Reporting Services integration.

Justin Angel on Windows 8, C# and Build

Windows 8 gives you the platform and tools to create rich app experiences where your customers focus on tasks that are important to them. Apps are at the center of the Windows 8 experience. They are alive with activity and vibrant content. Your customers immerse themselves in your full-screen, Metro style app allowing them to focus on their content rather than on the operating system.

With Windows 8 you can leverage your existing skills and code assets to create great experiences for your customers.

Web developers can use their HTML5, CSS3, and JavaScript skills to build native applications for Windows.

.NET Developers can use XAML, C#, and Visual Basic to build beautiful Metro style apps.

Game developers can use the power of DirectX 11.1 to build amazing, immersive gaming experiences.

Driver developers can use the new, integrated Microsoft® Visual Studio® development environment to increase productivity.

Justin Angel on Windows 8 Platform and Tools

C/C++ Developers and Metro Style Apps

Windows 8 and its new WinRT native libraries can be targeted by C/C++ developers just as the age-old Win32 libraries could be. This has not really changed and there are certainly many applications such as complex games, device drivers, etc. that require the kind of low level control that C/C++ offer. On the other hand, for 99% of Metro Style Apps such as social media apps, productivity tools, and business apps, C++ is not the answer in Win8 any more than it has been for the last 10 years.

XAML/C# Developers and Metro Style Apps

XAML/C# in Win 8 is the best option for the vast majority of Microsoft developers. The Silverlight/WPF community can bring their skills forward, though they will need to learn new controls and new APIs for working with WinRT as opposed to WPF/SL. General .NET developers who have not yet done anything with XAML will have a somewhat larger learning curve, but XAML itself is a very mature UI platform at this point, so it should be pretty easy for these developers to find the resources they need to quickly get up to speed with this.

Web Developers and Metro Style Apps

Web developers will likely find the HTML5+CSS+JS option attractive. There are also many Microsoft web developers, who build applications today using ASP.NET and C# (or perhaps VB) on the server, but who must also know CSS and JavaScript and HTML for the client work. Many of these developers including ASP.NET developers will likely opt to go the HTML5+CSS+JS route rather than the XAML route.

Rockford Lhotka on Windows 8, and WinRT

WinRT API is supported by the following technologies: WinRT .NET, WinRT HTML 5, and WinRT C++

WinRT .NET

I expect this to be the most widely used technology stack for building WinRT applications. The .NET available to WinRT applications is best thought of as being like .NET on the Windows Phone. It is basically the Silverlight subset of .NET, plus a bunch of WinRT-specific features and capabilities. The differences between Silverlight and WinRT are a bit more dramatic than with WP7, but the analogy remains quite accurate.

The XAML is very close to Silverlight and WPF, and the types of code you can write using C# and VB are very comparable to what you can write today using Silverlight.

Please note that using Silverlight today provides the easiest transition to WinRT in the future. Not seamless or trivial, but practical. In addiiton, WPF can enable a WinRT transition too – especially if you limit your use of WPF and .NET to the Silverlight subset of behaviors and features.

WinRT HTML 5

Microsoft has made much of the HTML 5 technology stack for building WinRT applications. In no way are we talking about web sites, web pages, or web applications here. This is smart client development done using technologies that were previously web-focused.

For a .NET developer, the technologies map like this:
HTML instead of XAML
JavaScript instead of C#
WinJS instead of the .NET BCL

In my conversations with traditional web developers, it is a brain-bending moment when I point out that there is no web server involved, and so no server-side code at all here. All the stuff that is done in ASP.NET or PHP is now done in JavaScript. From an architecture, design, and application functionality perspective, a WinRT HTML 5 app is almost, but not completely, unlike a web app.

On the positive side, if a web developer can learn and embrace the smart client architectural model, their skills with HTML, CSS, and JavaScript will carry over to this new platform. Some HTML and CSS assets, and perhaps some js assets, will carry from web development into this type of smart client development as well.

WinRT C++

Finally, C++ remains relevant on WinRT as well. This should come as no surprise, given that the Windows OS developers primarily use C++, and there’ll hopefully be games and other applications that are traditionally created using this technology.

I also suspect that Objective C apps will port to WinRT more directly through C++ than with C# or js, and (at least for my part) I hope that some of the existing iPad/iPhone apps quickly make their way onto WinRT so I can enjoy them.

Copyright © All Rights Reserved - C# Learners