📎 Webclip
Using Visual Studio to build Universal XAML Apps
The post says Visual Studio Update 2 RC adds features for building universal XAML and HTML apps that run on both Windows 8.1 and Windows Phone 8.1. It also points readers to a blog post or a Build talk for more detail.
Reading notes#
- New project templates provide the basic structure and configuration needed to share code and content across universal apps in C#, C++, and JavaScript.
- Existing Windows 8.1 apps can use the Add Windows Phone 8.1 command to add a Windows Phone 8.1 project and a shared project, and the reverse is also available.
- A universal app is made of a Windows Store project, a Windows Phone project, and a Shared project, with the platform projects producing the .appx packages.
- The Shared project holds content used by both platforms, supports item types such as .cs, xaml, .xml, .png, and .resw, and does not produce a binary output on its own.
- Shared code can use #if and #endif directives, and Visual Studio defines conditional compilation constants for C# and C++ to separate platform-specific code.
- In a Shared project, the project context switcher changes the active target and affects IntelliSense in the editor.
- The debug target dropdown can switch startup projects and lists the projects in the solution that can be deployed to a device or emulator or simulator.
- Code can be shared across universal apps with class libraries; for C# and Visual Basic, the post says Portable Class Libraries now support Windows Runtime and XAML for Windows 8.1 and Windows Phone 8.1.
- For C++, new Class Library project templates under Universal Apps can be used with shared projects to share code between Windows 8.1 and Windows Phone 8.1 class libraries.
