C#, VB, and C++ programming concepts for Windows Runtime apps

Applies to Windows and Windows Phone

Purpose

This section includes topics that explain programming concepts that are generally applicable to any app that you write, if you are using C#, Microsoft Visual Basic or Visual C++ component extensions (C++/CX) as your programming language and XAML for your UI definition. This includes basic programming concepts such as using properties and events, and how these apply to Windows Runtime app programming. The Windows Runtime extends C#, Visual Basic and C++ concepts of properties and their values by adding the dependency property system. Topics in this section also document the XAML language as it is used by the Windows Runtime, and cover basic scenarios and advanced topics explaining how to use XAML to define the UI for your Windows Runtime app.

In this section

TopicDescription

How to continue your Windows Phone app after calling an AndContinue method

Certain memory-intensive API on Windows Phone 8.1 contain AndContinue methods. When you call an AndContinue method, your app is deactivated while the operation completes in order to conserve memory. On low-memory devices, your app might even be terminated. Because of this possibility, you have to call different methods in a Windows Phone Store app than you call in a Windows Store app to continue your app after these operations. The following table shows these methods.

Dependency properties overview

This topic explains the dependency property system that is available when you write a Windows Runtime app using C++, C#, or Visual Basic along with XAML definitions for UI.

Custom dependency properties

Explains how to define and implement custom dependency properties for a Windows Runtime app using C++, C#, or Visual Basic.

Attached properties overview

Explains the concept of an attached property in XAML, and provides some examples.

Custom attached properties

Explains how to implement a XAML attached property as a dependency property and how to define the accessor convention that is necessary for your attached property to be usable in XAML.

Events and routed events overview

We describe the programming concept of events in a Windows Runtime app, when using C#, Visual Basic or C++/CX as your programming language, and XAML for your UI definition. You can assign handlers for events as part of the declarations for UI elements in XAML, or you can add the handlers in code. Windows Runtime supports routed events: certain input events and data events can be handled by objects beyond the object that fired the event. Routed events are useful when you define control templates, or use pages or layout containers.

Exception handling for Windows Runtime apps in C# or Visual Basic

Learn how to handle exceptions (or errors) in Windows Runtime apps using C# or Visual Basic. You can handle exceptions as Microsoft .NET exceptions with try-catch blocks in your app code, and you can process app-level exceptions by handling the Application.UnhandledException event.

Cross-reference: Standard exceptions and error codes

Cross-references Windows Runtime app error codes and symbolic HRESULTs to the .NET standard exceptions.

XAML overview

We introduce the XAML language and XAML concepts to the Windows Runtime app developer audience, and describe the different ways to declare objects and set attributes in XAML as it is used for creating a Windows Runtime app.

ResourceDictionary and XAML resource references

Explains how to define a ResourceDictionary element and keyed resources, and how XAML resources relate to other resources that you define as part of your app or app package.

XAML theme resources reference

Windows Runtime XAML provides a set of resources that apply different values depending on which system theme is active. Here we list the keys/names of all the theme-specific XAML resources that specify colors, brushes, and other related UI resources, and the values that each of these resources has using the themes Default (Light), Dark, and HighContrast. Also, we describe additional named XAML styles that are defined in themeresources.xaml. These styles are for text elements and text-related controls, and for view items from data.

 

Developer audience

This topic is for use by any Windows Runtime app developer that uses C#, Visual Basic, or C++/CX.

Related topics

Roadmap for Windows Runtime apps using C# or Visual Basic
Quickstart: Calling asynchronous APIs in C# or Visual Basic
.NET for Windows Store apps overview
Using the thread pool in Windows Store apps
Resources for other platform developers
Language reference for Windows Store apps

 

 

Community Additions

ADD
Show:
© 2014 Microsoft