MSDN Community

Windows.Foundation Namespace

The Windows.Foundation namespace provides core types and fundamental functionality used throughout the Windows Runtime (WinRT). This namespace is essential for almost all UWP development, offering base classes, common utilities, and essential data structures.

Classes

PropertyBag Class

public sealed class PropertyBag

Represents a collection of properties, allowing dynamic storage and retrieval of key-value pairs.

Public Methods

  • GetValue: Retrieves a value associated with a specified key.
  • SetValue: Associates a value with a specified key.
  • Remove: Removes a property by its key.

AsyncInfo Class

public static class AsyncInfo

Provides static methods for creating and managing asynchronous operations within the Windows Runtime.

Public Methods

  • Run: Starts an asynchronous operation.
  • Cancel: Cancels an asynchronous operation.
  • GetResults: Retrieves the results of a completed asynchronous operation.

Interfaces

IInspectable Interface

public interface IInspectable

The fundamental interface for all Windows Runtime objects. It provides runtime type information and introspection capabilities.

Key Members

  • GetIids: Retrieves the GUIDs of the interfaces supported by the object.
  • GetRuntimeClassName: Retrieves the fully qualified name of the runtime class.
  • GetTrustLevel: Retrieves the trust level of the object.

Structs

Point Struct

public struct Point

Represents a 2D point with X and Y coordinates.

Public Properties

  • X: The x-coordinate of the point.
  • Y: The y-coordinate of the point.

Size Struct

public struct Size

Represents a width and height.

Public Properties

  • Width: The width of the size.
  • Height: The height of the size.

Rect Struct

public struct Rect

Represents a rectangle with position and dimensions.

Public Properties

  • X: The x-coordinate of the top-left corner.
  • Y: The y-coordinate of the top-left corner.
  • Width: The width of the rectangle.
  • Height: The height of the rectangle.

Enums

AsyncStatus Enum

public enum AsyncStatus

Indicates the status of an asynchronous operation.

Members

  • Started: The operation has started but not completed.
  • Completed: The operation has completed successfully.
  • Canceled: The operation was canceled.