Windows App SDK API Documentation

Overview

Welcome to the comprehensive API documentation for the Windows App SDK. This SDK provides a set of modern APIs and frameworks designed to help you build the next generation of Windows applications.

This documentation covers namespaces, classes, methods, properties, and events essential for leveraging the full power of the Windows App SDK.

Use the navigation pane on the left to explore different API areas and find the specific documentation you need.

WinRT

WinRT Core
GetActivationFactory WinRT.IActivationFactory GetActivationFactory(string className)

Retrieves the activation factory for a given Windows Runtime class.

Returns: An instance of IActivationFactory.
className: The name of the Windows Runtime class.
GetRuntimeClassName string GetRuntimeClassName(object obj)

Gets the runtime class name of an object.

Returns: The runtime class name as a string.
obj: The object to query.

App Model

Microsoft.Windows.AppLifecycle
GetActivatedEventArgs IActivatedEventArgs GetActivatedEventArgs()

Retrieves information about the activation event that launched the application.

Returns: An object implementing IActivatedEventArgs.
RegisterForNextActivation void RegisterForNextActivation(string activationId)

Registers the application to receive a specific type of activation event.

activationId: The ID of the activation to register for.
Microsoft.Windows.AppNotifications
CreateNotification AppNotificationBuilder CreateNotification()

Starts building a new app notification.

Returns: An AppNotificationBuilder instance.
Show void Show(AppNotificationBuilder builder)

Displays an app notification to the user.

builder: The AppNotificationBuilder to use for constructing the notification.

Controls

Microsoft.UI.Xaml.Controls
Button Button()

Initializes a new instance of the Button class.

C# Example:
var button = new Button(); button.Content = "Click Me"; myGrid.Children.Add(button);
TextBox TextBox()

Initializes a new instance of the TextBox class.

ListView ListView()

Initializes a new instance of the ListView class.

Networking

Microsoft.Windows.Networking
HttpClient HttpClient()

Initializes a new instance of the HttpClient class for sending HTTP requests.

C# Example:
var client = new HttpClient(); var response = await client.GetAsync("https://api.example.com");

Storage

Microsoft.Windows.Storage
GetKnownFolderAsync IAsyncOperation<StorageFolder> GetKnownFolderAsync(KnownFolderId folderId)

Gets a folder that is known to the system, such as Documents or Pictures.

Returns: An async operation that resolves to a StorageFolder.
folderId: The identifier for the known folder.

UI

Microsoft.UI.Xaml
Window Window()

Creates a new top-level window.

Input

Microsoft.UI.Input
PointerPoint PointerPoint()

Represents a point in a pointer input event.

Graphics

Microsoft.UI.Composition
Compositor Compositor()

Creates a new instance of the Compositor class.

Data Types

System Types
String string

Represents a sequence of characters.

Int32 int

Represents a 32-bit signed integer.

Boolean bool

Represents a Boolean value (true or false).

DateTime DateTime

Represents a point in time.

Events & Delegates

Microsoft.UI.Xaml.Input
PointerEventHandler delegate void PointerEventHandler(object sender, PointerEventArgs e)

Represents a method that will handle a pointer input event.