diff --git a/hub/apps/design/layout/attached-layouts.md b/hub/apps/design/layout/attached-layouts.md index ec27d0d391..047c8a7f6d 100644 --- a/hub/apps/design/layout/attached-layouts.md +++ b/hub/apps/design/layout/attached-layouts.md @@ -597,7 +597,7 @@ The snippet below shows the additional logic that could be added to the MeasureO for (int i = state.LastRealizedIndex; i < newLastRealizedIndex; i++) { - context.RecycleElement(context.IndexElementMap.Get(i)); + context.RecycleElement(state.IndexToElementMap.Get(i)); state.IndexToElementMap.Clear(i); } diff --git a/hub/apps/develop/dispatcherqueue.md b/hub/apps/develop/dispatcherqueue.md index cc04aed321..f3311cc34a 100644 --- a/hub/apps/develop/dispatcherqueue.md +++ b/hub/apps/develop/dispatcherqueue.md @@ -55,7 +55,7 @@ void RunCustomMessageLoop() { if (!ContentPreTranslateMessage(&msg)) { - TranslateMesasge(&msg); + TranslateMessage(&msg); DispatchMessage(&msg); } } diff --git a/hub/apps/develop/input/focus-navigation-programmatic.md b/hub/apps/develop/input/focus-navigation-programmatic.md index 0ea0679a0b..4407c6b147 100644 --- a/hub/apps/develop/input/focus-navigation-programmatic.md +++ b/hub/apps/develop/input/focus-navigation-programmatic.md @@ -306,7 +306,7 @@ Here, we show how to specify that the buttons of a CommandBar have a wrap-around ```csharp private void OnLosingFocus(UIElement sender, LosingFocusEventArgs args) { - if (IsNotAChildOf(MyCommandBar, args.NewFocussedElement)) + if (IsNotAChildOf(MyCommandBar, args.NewFocusedElement)) { DependencyObject candidate = null; if (args.Direction == FocusNavigationDirection.Left) diff --git a/hub/apps/develop/input/handle-pointer-input.md b/hub/apps/develop/input/handle-pointer-input.md index a0416ee6cc..9f9f9d41c4 100644 --- a/hub/apps/develop/input/handle-pointer-input.md +++ b/hub/apps/develop/input/handle-pointer-input.md @@ -5,7 +5,7 @@ ms.assetid: BDBC9E33-4037-4671-9596-471DCF855C82 label: Handle pointer input template: detail.hbs keywords: pen, mouse, touchpad, touch, pointer, input, user interaction -ms.date: 09/24/2020 +ms.date: 04/22/2026 ms.topic: how-to ms.localizationpriority: medium --- @@ -19,9 +19,9 @@ Receive, process, and manage input data from pointing devices (such as touch, mo > If you customize the interaction experiences in your Windows application, users expect them to be consistent, intuitive, and discoverable. For these reasons, we recommend that you model your custom interactions on those supported by the [platform controls](../../design/controls/index.md). The platform controls provide the full Windows app user interaction experience, including standard interactions, animated physics effects, visual feedback, and accessibility. ## Important APIs -- [Windows.Devices.Input](/uwp/api/Windows.Devices.Input) -- [Windows.UI.Input](/uwp/api/Windows.UI.Core) -- [Windows.UI.Xaml.Input](/uwp/api/Windows.UI.Input) +- [Microsoft.UI.Input](/windows/windows-app-sdk/api/winrt/microsoft.ui.input) +- [Microsoft.UI.Xaml.Input](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input) + ## Pointers Most interaction experiences typically involve the user identifying the object they want to interact with by pointing at it through input devices such as touch, mouse, pen/stylus, and touchpad. Because the raw Human Interface Device (HID) data provided by these input devices includes many common properties, the data is promoted and consolidated into a unified input stack and exposed as device-agnostic pointer data. Your Windows applications can then consume this data without worrying about the input device being used. @@ -29,7 +29,7 @@ Most interaction experiences typically involve the user identifying the object t > [!NOTE] > Device-specific info is also promoted from the raw HID data should your app require it. -Each input point (or contact) on the input stack is represented by a [**Pointer**](/uwp/api/Windows.UI.Xaml.Input.Pointer) object exposed through the [**PointerRoutedEventArgs**](/uwp/api/Windows.UI.Xaml.Input.PointerRoutedEventArgs) parameter in the various pointer event handlers. In the case of multi-pen or multi-touch input, each contact is treated as a unique input pointer. +Each input point (or contact) on the input stack is represented by a [**Pointer**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Input.Pointer) object exposed through the [**PointerRoutedEventArgs**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Input.PointerRoutedEventArgs) parameter in the various pointer event handlers. In the case of multi-pen or multi-touch input, each contact is treated as a unique input pointer. ## Pointer events @@ -38,18 +38,18 @@ Pointer events expose basic info such as input device type and detection state ( Windows apps can listen for the following pointer events: > [!NOTE] -> Constrain pointer input to a specific UI element by calling [**CapturePointer**](/uwp/api/windows.ui.xaml.uielement.capturepointer) on that element within a pointer event handler. When a pointer is captured by an element, only that object receives pointer input events, even when the pointer moves outside the bounding area of the object. The [**IsInContact**](/uwp/api/windows.ui.xaml.input.pointer.isincontact) (mouse button pressed, touch or stylus in contact) must be true for **CapturePointer** to be successful. +> Constrain pointer input to a specific UI element by calling [**CapturePointer**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.capturepointer) on that element within a pointer event handler. When a pointer is captured by an element, only that object receives pointer input events, even when the pointer moves outside the bounding area of the object. The [**IsInContact**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointer.isincontact) (mouse button pressed, touch or stylus in contact) must be true for **CapturePointer** to be successful. | Event | Description | |---|---| -| [**PointerCanceled**](/uwp/api/windows.ui.xaml.uielement.pointercanceled) | Occurs when a pointer is canceled by the platform. This can occur in the following circumstances:
• Touch pointers are canceled when a pen is detected within range of the input surface.
• An active contact is not detected for more than 100 ms.
• Monitor/display is changed (resolution, settings, multi-mon configuration).
• The desktop is locked or the user has logged off.
• The number of simultaneous contacts exceeded the number supported by the device. | -| [**PointerCaptureLost**](/uwp/api/windows.ui.xaml.uielement.pointercapturelost) | Occurs when another UI element captures the pointer, the pointer was released, or another pointer was programmatically captured.
**Note:** There is no corresponding pointer capture event. | -| [**PointerEntered**](/uwp/api/windows.ui.xaml.uielement.pointerentered) | Occurs when a pointer enters the bounding area of an element. This can happen in slightly different ways for touch, touchpad, mouse, and pen input.
• Touch requires a finger contact to fire this event, either from a direct touch down on the element or from moving into the bounding area of the element.
• Mouse and touchpad both have an on-screen cursor that is always visible and fires this event even if no mouse or touchpad button is pressed.
• Like touch, pen fires this event with a direct pen down on the element or from moving into the bounding area of the element. However, pen also has a hover state ([IsInRange](/uwp/api/windows.ui.xaml.input.pointer.isinrange)) that, when true, fires this event. | -| [**PointerExited**](/uwp/api/windows.ui.xaml.uielement.pointerexited) | Occurs when a pointer leaves the bounding area of an element. This can happen in slightly different ways for touch, touchpad, mouse, and pen input.
• Touch requires a finger contact and fires this event when the pointer moves out of the bounding area of the element.
• Mouse and touchpad both have an on-screen cursor that is always visible and fires this event even if no mouse or touchpad button is pressed.
• Like touch, pen fires this event when moving out of the bounding area of the element. However, pen also has a hover state ([IsInRange](/uwp/api/windows.ui.xaml.input.pointer.isinrange)) that fires this event when the state changes from true to false. | -| [**PointerMoved**](/uwp/api/windows.ui.xaml.uielement.pointermoved) | Occurs when a pointer changes coordinates, button state, pressure, tilt, or contact geometry (for example, width and height) within the bounding area of an element. This can happen in slightly different ways for touch, touchpad, mouse, and pen input.
• Touch requires a finger contact and fires this event only when in contact within the bounding area of the element.
• Mouse and touchpad both have an on-screen cursor that is always visible and fires this event even if no mouse or touchpad button is pressed.
• Like touch, pen fires this event when in contact within the bounding area of the element. However, pen also has a hover state ([IsInRange](/uwp/api/windows.ui.xaml.input.pointer.isinrange)) that, when true and within the bounding area of the element, fires this event. | -| [**PointerPressed**](/uwp/api/windows.ui.xaml.uielement.pointerpressed) | Occurs when the pointer indicates a press action (such as a touch down, mouse button down, pen down, or touchpad button down) within the bounding area of an element.
[CapturePointer](/uwp/api/windows.ui.xaml.uielement.capturepointer) must be called from the handler for this event. | -| [**PointerReleased**](/uwp/api/windows.ui.xaml.uielement.pointerreleased) | Occurs when the pointer indicates a release action (such as a touch up, mouse button up, pen up, or touchpad button up) within the bounding area of an element or, if the pointer is captured, outside the bounding area. | -| [**PointerWheelChanged**](/uwp/api/windows.ui.xaml.uielement.pointerwheelchanged) | Occurs when the mouse wheel is rotated.
Mouse input is associated with a single pointer assigned when mouse input is first detected. Clicking a mouse button (left, wheel, or right) creates a secondary association between the pointer and that button through the [PointerMoved](/uwp/api/windows.ui.xaml.uielement.pointermoved) event. |  +| [**PointerCanceled**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercanceled) | Occurs when a pointer is canceled by the platform. This can occur in the following circumstances:
• Touch pointers are canceled when a pen is detected within range of the input surface.
• An active contact is not detected for more than 100 ms.
• Monitor/display is changed (resolution, settings, multi-mon configuration).
• The desktop is locked or the user has logged off.
• The number of simultaneous contacts exceeded the number supported by the device. | +| [**PointerCaptureLost**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercapturelost) | Occurs when another UI element captures the pointer, the pointer was released, or another pointer was programmatically captured.
**Note:** There is no corresponding pointer capture event. | +| [**PointerEntered**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerentered) | Occurs when a pointer enters the bounding area of an element. This can happen in slightly different ways for touch, touchpad, mouse, and pen input.
• Touch requires a finger contact to fire this event, either from a direct touch down on the element or from moving into the bounding area of the element.
• Mouse and touchpad both have an on-screen cursor that is always visible and fires this event even if no mouse or touchpad button is pressed.
• Like touch, pen fires this event with a direct pen down on the element or from moving into the bounding area of the element. However, pen also has a hover state ([IsInRange](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointer.isinrange)) that, when true, fires this event. | +| [**PointerExited**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerexited) | Occurs when a pointer leaves the bounding area of an element. This can happen in slightly different ways for touch, touchpad, mouse, and pen input.
• Touch requires a finger contact and fires this event when the pointer moves out of the bounding area of the element.
• Mouse and touchpad both have an on-screen cursor that is always visible and fires this event even if no mouse or touchpad button is pressed.
• Like touch, pen fires this event when moving out of the bounding area of the element. However, pen also has a hover state ([IsInRange](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointer.isinrange)) that fires this event when the state changes from true to false. | +| [**PointerMoved**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointermoved) | Occurs when a pointer changes coordinates, button state, pressure, tilt, or contact geometry (for example, width and height) within the bounding area of an element. This can happen in slightly different ways for touch, touchpad, mouse, and pen input.
• Touch requires a finger contact and fires this event only when in contact within the bounding area of the element.
• Mouse and touchpad both have an on-screen cursor that is always visible and fires this event even if no mouse or touchpad button is pressed.
• Like touch, pen fires this event when in contact within the bounding area of the element. However, pen also has a hover state ([IsInRange](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointer.isinrange)) that, when true and within the bounding area of the element, fires this event. | +| [**PointerPressed**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerpressed) | Occurs when the pointer indicates a press action (such as a touch down, mouse button down, pen down, or touchpad button down) within the bounding area of an element.
[CapturePointer](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.capturepointer) must be called from the handler for this event. | +| [**PointerReleased**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerreleased) | Occurs when the pointer indicates a release action (such as a touch up, mouse button up, pen up, or touchpad button up) within the bounding area of an element or, if the pointer is captured, outside the bounding area. | +| [**PointerWheelChanged**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerwheelchanged) | Occurs when the mouse wheel is rotated.
Mouse input is associated with a single pointer assigned when mouse input is first detected. Clicking a mouse button (left, wheel, or right) creates a secondary association between the pointer and that button through the [PointerMoved](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointermoved) event. |  ## Pointer event example @@ -57,13 +57,13 @@ Here are some code snippets from a basic pointer tracking app that show how to l ![Pointer application UI](images/pointers/pointers1.gif) -**Download this sample from [Pointer input sample (basic)](https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-pointers.zip)** +**See the complete sample: [Input sample (WinUI 3)](https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/Input/cs-winui)** ### Create the UI -For this example, we use a [Rectangle](/uwp/api/windows.ui.xaml.shapes.rectangle) (`Target`) as the object consuming pointer input. The color of the target changes when the pointer status changes. +For this example, we use a [Rectangle](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.shapes.rectangle) (`Target`) as the object consuming pointer input. The color of the target changes when the pointer status changes. -Details for each pointer are displayed in a floating [TextBlock](/uwp/api/Windows.UI.Xaml.Controls.TextBlock) that follows the pointer as it moves. The pointer events themselves are reported in the [RichTextBlock](/uwp/api/Windows.UI.Xaml.Controls.RichTextBlock) to the right of the rectangle. +Details for each pointer are displayed in a floating [TextBlock](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Controls.TextBlock) that follows the pointer as it moves. The pointer events themselves are reported in the [RichTextBlock](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Controls.RichTextBlock) to the right of the rectangle. This is the Extensible Application Markup Language (XAML) for the UI in this example. @@ -120,9 +120,9 @@ This is the Extensible Application Markup Language (XAML) for the UI in this exa ### Listen for pointer events -In most cases, we recommend that you get pointer info through the [**PointerRoutedEventArgs**](/uwp/api/Windows.UI.Xaml.Input.PointerRoutedEventArgs) of the event handler. +In most cases, we recommend that you get pointer info through the [**PointerRoutedEventArgs**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Input.PointerRoutedEventArgs) of the event handler. -If the event argument doesn't expose the pointer details required, you can get access to extended [**PointerPoint**](/uwp/api/Windows.UI.Input.PointerPoint) info exposed through the [**GetCurrentPoint**](/uwp/api/windows.ui.xaml.input.pointerroutedeventargs.getcurrentpoint) and [**GetIntermediatePoints**](/uwp/api/windows.ui.xaml.input.pointerroutedeventargs.getintermediatepoints) methods of [**PointerRoutedEventArgs**](/uwp/api/Windows.UI.Xaml.Input.PointerRoutedEventArgs). +If the event argument doesn't expose the pointer details required, you can get access to extended [**PointerPoint**](/windows/windows-app-sdk/api/winrt/microsoft.ui.input.PointerPoint) info exposed through the [**GetCurrentPoint**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointerroutedeventargs.getcurrentpoint) and [**GetIntermediatePoints**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointerroutedeventargs.getintermediatepoints) methods of [**PointerRoutedEventArgs**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Input.PointerRoutedEventArgs). The following code sets up the global dictionary object for tracking each active pointer, and identifies the various pointer event listeners for the target object. @@ -130,14 +130,14 @@ The following code sets up the global dictionary object for tracking each active // Dictionary to maintain information about each active pointer. // An entry is added during PointerPressed/PointerEntered events and removed // during PointerReleased/PointerCaptureLost/PointerCanceled/PointerExited events. -Dictionary pointers; +Dictionary pointers; public MainPage() { this.InitializeComponent(); // Initialize the dictionary. - pointers = new Dictionary(); + pointers = new Dictionary(); // Declare the pointer event handlers. Target.PointerPressed += @@ -166,10 +166,10 @@ public MainPage() Next, we use UI feedback to demonstrate basic pointer event handlers. -- This handler manages the [**PointerPressed**](/uwp/api/windows.ui.xaml.uielement.pointerpressed) event. We add the event to the event log, add the pointer to the active pointer dictionary, and display the pointer details. +- This handler manages the [**PointerPressed**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerpressed) event. We add the event to the event log, add the pointer to the active pointer dictionary, and display the pointer details. > [!NOTE] - > [**PointerPressed**](/uwp/api/windows.ui.xaml.uielement.pointerpressed) and [**PointerReleased**](/uwp/api/windows.ui.xaml.uielement.pointerreleased) events do not always occur in pairs. Your app should listen for and handle any event that might conclude a pointer down (such as [**PointerExited**](/uwp/api/windows.ui.xaml.uielement.pointerexited), [**PointerCanceled**](/uwp/api/windows.ui.xaml.uielement.pointercanceled), and [**PointerCaptureLost**](/uwp/api/windows.ui.xaml.uielement.pointercapturelost)). + > [**PointerPressed**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerpressed) and [**PointerReleased**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerreleased) events do not always occur in pairs. Your app should listen for and handle any event that might conclude a pointer down (such as [**PointerExited**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerexited), [**PointerCanceled**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercanceled), and [**PointerCaptureLost**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercapturelost)).   ```csharp @@ -205,14 +205,14 @@ void Target_PointerPressed(object sender, PointerRoutedEventArgs e) } // Change background color of target when pointer contact detected. - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Green); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Green); // Display pointer details. CreateInfoPop(ptrPt); } ``` -- This handler manages the [**PointerEntered**](/uwp/api/windows.ui.xaml.uielement.pointerentered) event. We add the event to the event log, add the pointer to the pointer collection, and display the pointer details. +- This handler manages the [**PointerEntered**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerentered) event. We add the event to the event log, add the pointer to the pointer collection, and display the pointer details. ```csharp /// @@ -241,7 +241,7 @@ private void Target_PointerEntered(object sender, PointerRoutedEventArgs e) if (pointers.Count == 0) { // Change background color of target when pointer contact detected. - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Blue); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Blue); } // Display pointer details. @@ -249,10 +249,10 @@ private void Target_PointerEntered(object sender, PointerRoutedEventArgs e) } ``` -- This handler manages the [**PointerMoved**](/uwp/api/windows.ui.xaml.uielement.pointermoved) event. We add the event to the event log and update the pointer details. +- This handler manages the [**PointerMoved**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointermoved) event. We add the event to the event log and update the pointer details. > [!Important] - > Mouse input is associated with a single pointer assigned when mouse input is first detected. Clicking a mouse button (left, wheel, or right) creates a secondary association between the pointer and that button through the [**PointerPressed**](/uwp/api/windows.ui.xaml.uielement.pointerpressed) event. The [**PointerReleased**](/uwp/api/windows.ui.xaml.uielement.pointerreleased) event is fired only when that same mouse button is released (no other button can be associated with the pointer until this event is complete). Because of this exclusive association, other mouse button clicks are routed through the [**PointerMoved**](/uwp/api/windows.ui.xaml.uielement.pointermoved) event.   + > Mouse input is associated with a single pointer assigned when mouse input is first detected. Clicking a mouse button (left, wheel, or right) creates a secondary association between the pointer and that button through the [**PointerPressed**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerpressed) event. The [**PointerReleased**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerreleased) event is fired only when that same mouse button is released (no other button can be associated with the pointer until this event is complete). Because of this exclusive association, other mouse button clicks are routed through the [**PointerMoved**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointermoved) event.   ```csharp /// @@ -278,7 +278,7 @@ private void Target_PointerMoved(object sender, PointerRoutedEventArgs e) // is released. // Because of this exclusive association, other mouse button clicks are // routed through the pointer move event. - if (ptrPt.PointerDevice.PointerDeviceType == Windows.Devices.Input.PointerDeviceType.Mouse) + if (ptrPt.PointerDeviceType == Microsoft.UI.Input.PointerDeviceType.Mouse) { if (ptrPt.Properties.IsLeftButtonPressed) { @@ -299,7 +299,7 @@ private void Target_PointerMoved(object sender, PointerRoutedEventArgs e) } ``` -- This handler manages the [**PointerWheelChanged**](/uwp/api/windows.ui.xaml.uielement.pointerwheelchanged) event. We add the event to the event log, add the pointer to the pointer array (if necessary), and display the pointer details. +- This handler manages the [**PointerWheelChanged**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerwheelchanged) event. We add the event to the event log, add the pointer to the pointer array (if necessary), and display the pointer details. ```csharp /// @@ -329,7 +329,7 @@ private void Target_PointerWheelChanged(object sender, PointerRoutedEventArgs e) } ``` -- This handler manages the [**PointerReleased**](/uwp/api/windows.ui.xaml.uielement.pointerreleased) event where contact with the digitizer is terminated. We add the event to the event log, remove the pointer from the pointer collection, and update the pointer details. +- This handler manages the [**PointerReleased**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerreleased) event where contact with the digitizer is terminated. We add the event to the event log, remove the pointer from the pointer collection, and update the pointer details. ```csharp /// @@ -354,10 +354,10 @@ void Target_PointerReleased(object sender, PointerRoutedEventArgs e) // over the target, retain pointer and pointer details. // Return without removing pointer from pointers dictionary. // For this example, we assume a maximum of one mouse pointer. - if (ptrPt.PointerDevice.PointerDeviceType != Windows.Devices.Input.PointerDeviceType.Mouse) + if (ptrPt.PointerDeviceType != Microsoft.UI.Input.PointerDeviceType.Mouse) { // Update target UI. - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Red); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Red); DestroyInfoPop(ptrPt); @@ -376,12 +376,12 @@ void Target_PointerReleased(object sender, PointerRoutedEventArgs e) } else { - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Blue); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Blue); } } ``` -- This handler manages the [**PointerExited**](/uwp/api/windows.ui.xaml.uielement.pointerexited) event (when contact with the digitizer is maintained). We add the event to the event log, remove the pointer from the pointer array, and update the pointer details. +- This handler manages the [**PointerExited**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerexited) event (when contact with the digitizer is maintained). We add the event to the event log, remove the pointer from the pointer array, and update the pointer details. ```csharp /// @@ -408,7 +408,7 @@ private void Target_PointerExited(object sender, PointerRoutedEventArgs e) if (pointers.Count == 0) { - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Red); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Red); } // Update the UI and pointer details. @@ -416,7 +416,7 @@ private void Target_PointerExited(object sender, PointerRoutedEventArgs e) } ``` -- This handler manages the [**PointerCanceled**](/uwp/api/windows.ui.xaml.uielement.pointercanceled) event. We add the event to the event log, remove the pointer from the pointer array, and update the pointer details. +- This handler manages the [**PointerCanceled**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercanceled) event. We add the event to the event log, remove the pointer from the pointer array, and update the pointer details. ```csharp /// @@ -448,17 +448,17 @@ private void Target_PointerCanceled(object sender, PointerRoutedEventArgs e) if (pointers.Count == 0) { - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Black); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Black); } DestroyInfoPop(ptrPt); } ``` -- This handler manages the [**PointerCaptureLost**](/uwp/api/windows.ui.xaml.uielement.pointercapturelost) event. We add the event to the event log, remove the pointer from the pointer array, and update the pointer details. +- This handler manages the [**PointerCaptureLost**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercapturelost) event. We add the event to the event log, remove the pointer from the pointer array, and update the pointer details. > [!NOTE] - > [**PointerCaptureLost**](/uwp/api/windows.ui.xaml.uielement.pointercapturelost) can occur instead of [**PointerReleased**](/uwp/api/windows.ui.xaml.uielement.pointerreleased). Pointer capture can be lost for various reasons including user interaction, programmatic capture of another pointer, calling [**PointerReleased**](/uwp/api/windows.ui.xaml.uielement.pointerreleased).   + > [**PointerCaptureLost**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointercapturelost) can occur instead of [**PointerReleased**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerreleased). Pointer capture can be lost for various reasons including user interaction, programmatic capture of another pointer, calling [**PointerReleased**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.pointerreleased).   ```csharp /// @@ -483,7 +483,7 @@ private void Target_PointerCaptureLost(object sender, PointerRoutedEventArgs e) if (pointers.Count == 0) { - Target.Fill = new SolidColorBrush(Windows.UI.Colors.Black); + Target.Fill = new SolidColorBrush(Microsoft.UI.Colors.Black); } // Remove contact from dictionary. @@ -499,9 +499,9 @@ private void Target_PointerCaptureLost(object sender, PointerRoutedEventArgs e) ### Get pointer properties -As stated earlier, you must get most extended pointer info from a [**Windows.UI.Input.PointerPoint**](/uwp/api/Windows.UI.Input.PointerPoint) object obtained through the [**GetCurrentPoint**](/uwp/api/windows.ui.xaml.input.pointerroutedeventargs.getcurrentpoint) and [**GetIntermediatePoints**](/uwp/api/windows.ui.xaml.input.pointerroutedeventargs.getintermediatepoints) methods of [**PointerRoutedEventArgs**](/uwp/api/Windows.UI.Xaml.Input.PointerRoutedEventArgs). The following code snippets show how. +As stated earlier, you must get most extended pointer info from a [**Microsoft.UI.Input.PointerPoint**](/windows/windows-app-sdk/api/winrt/microsoft.ui.input.PointerPoint) object obtained through the [**GetCurrentPoint**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointerroutedeventargs.getcurrentpoint) and [**GetIntermediatePoints**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.input.pointerroutedeventargs.getintermediatepoints) methods of [**PointerRoutedEventArgs**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Input.PointerRoutedEventArgs). The following code snippets show how. -- First, we create a new [**TextBlock**](/uwp/api/Windows.UI.Xaml.Controls.TextBlock) for each pointer. +- First, we create a new [**TextBlock**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Controls.TextBlock) for each pointer. ```csharp /// @@ -512,7 +512,7 @@ void CreateInfoPop(PointerPoint ptrPt) { TextBlock pointerDetails = new TextBlock(); pointerDetails.Name = ptrPt.PointerId.ToString(); - pointerDetails.Foreground = new SolidColorBrush(Windows.UI.Colors.White); + pointerDetails.Foreground = new SolidColorBrush(Microsoft.UI.Colors.White); pointerDetails.Text = QueryPointer(ptrPt); TranslateTransform x = new TranslateTransform(); @@ -524,7 +524,7 @@ void CreateInfoPop(PointerPoint ptrPt) } ``` -- Then we provide a way to update the pointer info in an existing [**TextBlock**](/uwp/api/Windows.UI.Xaml.Controls.TextBlock) associated with that pointer. +- Then we provide a way to update the pointer info in an existing [**TextBlock**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Controls.TextBlock) associated with that pointer. ```csharp /// @@ -535,7 +535,7 @@ void UpdateInfoPop(PointerPoint ptrPt) { foreach (var pointerDetails in Container.Children) { - if (pointerDetails.GetType().ToString() == "Windows.UI.Xaml.Controls.TextBlock") + if (pointerDetails.GetType().ToString() == "Microsoft.UI.Xaml.Controls.TextBlock") { TextBlock textBlock = (TextBlock)pointerDetails; if (textBlock.Name == ptrPt.PointerId.ToString()) @@ -566,12 +566,12 @@ String QueryPointer(PointerPoint ptrPt) { String details = ""; - switch (ptrPt.PointerDevice.PointerDeviceType) + switch (ptrPt.PointerDeviceType) { - case Windows.Devices.Input.PointerDeviceType.Mouse: + case Microsoft.UI.Input.PointerDeviceType.Mouse: details += "\nPointer type: mouse"; break; - case Windows.Devices.Input.PointerDeviceType.Pen: + case Microsoft.UI.Input.PointerDeviceType.Pen: details += "\nPointer type: pen"; if (ptrPt.IsInContact) { @@ -582,7 +582,7 @@ String QueryPointer(PointerPoint ptrPt) details += "\nBarrel button pressed: " + ptrPt.Properties.IsBarrelButtonPressed; } break; - case Windows.Devices.Input.PointerDeviceType.Touch: + case Microsoft.UI.Input.PointerDeviceType.Touch: details += "\nPointer type: touch"; details += "\nrotation: " + ptrPt.Properties.Orientation; details += "\nTilt X: " + ptrPt.Properties.XTilt; @@ -608,7 +608,7 @@ String QueryPointer(PointerPoint ptrPt) ## Primary pointer Some input devices, such as a touch digitizer or touchpad, support more than the typical single pointer of a mouse or a pen (in most cases as the Surface Hub supports two pen inputs). -Use the read-only **[IsPrimary](/uwp/api/windows.ui.input.pointerpointproperties.IsPrimary)** property of the **[PointerPointerProperties](/uwp/api/windows.ui.input.pointerpointproperties)** class to identify and differentiate a single primary pointer (the primary pointer is always the first pointer detected during an input sequence). +Use the read-only **[IsPrimary](/windows/windows-app-sdk/api/winrt/microsoft.ui.input.pointerpointproperties.IsPrimary)** property of the **[PointerPointerProperties](/windows/windows-app-sdk/api/winrt/microsoft.ui.input.pointerpointproperties)** class to identify and differentiate a single primary pointer (the primary pointer is always the first pointer detected during an input sequence). By identifying the primary pointer, you can use it to emulate mouse or pen input, customize interactions, or provide some other specific functionality or UI. @@ -623,20 +623,20 @@ This particular app uses both color and animation to highlight the primary point ![Pointer application with animated visual feedback](images/pointers/pointers-usercontrol-animation.gif) -**Download this sample from [Pointer input sample (UserControl with animation)](https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-pointers-animation.zip)** +**See [GestureRecognizer.xaml.cs](https://github.com/microsoft/WindowsAppSDK-Samples/blob/main/Samples/Input/cs-winui/GestureRecognizer.xaml.cs) for a complete example using pointer events with GestureRecognizer.** ### Visual feedback -We define a **[UserControl](/uwp/api/windows.ui.xaml.controls.usercontrol)**, based on a XAML **[Ellipse](/uwp/api/windows.ui.xaml.shapes.ellipse)** object, that highlights where each pointer is on the canvas and uses a **[Storyboard](/uwp/api/windows.ui.xaml.media.animation.storyboard)** to animate the ellipse that corresponds to the primary pointer. +We define a **[UserControl](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.usercontrol)**, based on a XAML **[Ellipse](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.shapes.ellipse)** object, that highlights where each pointer is on the canvas and uses a **[Storyboard](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.animation.storyboard)** to animate the ellipse that corresponds to the primary pointer. **Here's the XAML:** ```xaml /// Pointer feedback object. @@ -819,7 +819,7 @@ namespace UWP_Pointers ``` ### Create the UI -The UI in this example is limited to the input **[Canvas](/uwp/api/windows.ui.xaml.controls.canvas)** where we track any pointers and render the pointer indicators and primary pointer animation (if applicable), along with a header bar containing a pointer counter and a primary pointer identifier. +The UI in this example is limited to the input **[Canvas](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.canvas)** where we track any pointers and render the pointer indicators and primary pointer animation (if applicable), along with a header bar containing a pointer counter and a primary pointer identifier. Here's the MainPage.xaml: @@ -872,27 +872,12 @@ Here's the MainPage.xaml: ### Handle pointer events -Finally, we define our basic pointer event handlers in the MainPage.xaml.cs code-behind. We won't reproduce the code here as the basics were covered in the previous example, but you can download the working sample from [Pointer input sample (UserControl with animation)](https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-pointers-animation.zip). +Finally, we define our basic pointer event handlers in the MainPage.xaml.cs code-behind. We won't reproduce the code here as the basics were covered in the previous example. See the [Input sample](https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/Input/cs-winui) for a complete working project. ## Related articles -### Topic samples - -- [Pointer input sample (basic)](https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-pointers.zip) -- [Pointer input sample (UserControl with animation)](https://github.com/MicrosoftDocs/windows-topic-specific-samples/archive/uwp-pointers-animation.zip) - -### Other samples - -- [Basic input sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BasicInput) -- [Low latency input sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/LowLatencyInput) -- [User interaction mode sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/UserInteractionMode) -- [Focus visuals sample](https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/XamlFocusVisuals) - -### Archive samples +### Samples -- [Input: XAML user input events sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/411c271e537727d737a53fa2cbe99eaecac00cc0/Official%20Windows%20Platform%20Sample/Input%20XAML%20user%20input%20events%20sample) -- [Input: Device capabilities sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/411c271e537727d737a53fa2cbe99eaecac00cc0/Official%20Windows%20Platform%20Sample/Windows%208%20app%20samples/%5BC%23%5D-Windows%208%20app%20samples/C%23/Windows%208%20app%20samples/Input%20Device%20capabilities%20sample%20(Windows%208)) -- [Input: Manipulations and gestures sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/411c271e537727d737a53fa2cbe99eaecac00cc0/Official%20Windows%20Platform%20Sample/Input%20Gestures%20and%20manipulations%20with%20GestureRecognizer) -- [Input: Touch hit testing sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/411c271e537727d737a53fa2cbe99eaecac00cc0/Official%20Windows%20Platform%20Sample/Windows%208%20desktop%20samples/%5BC%2B%2B%5D-Windows%208%20desktop%20samples/C%2B%2B/Windows%208%20desktop%20samples/Input%20Touch%20hit%20testing%20sample) -- [XAML scrolling, panning, and zooming sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/411c271e537727d737a53fa2cbe99eaecac00cc0/Official%20Windows%20Platform%20Sample/Universal%20Windows%20app%20samples/111487-Universal%20Windows%20app%20samples/XAML%20scrolling%2C%20panning%2C%20and%20zooming%20sample) -- [Input: Simplified ink sample](https://github.com/microsoftarchive/msdn-code-gallery-microsoft/tree/411c271e537727d737a53fa2cbe99eaecac00cc0/Official%20Windows%20Platform%20Sample/Input%20Simplified%20ink%20sample) +- [Input sample (WinUI 3)](https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/Input/cs-winui) — Demonstrates pointer events, gesture recognition, and input cursors +- [GestureRecognizer.xaml.cs](https://github.com/microsoft/WindowsAppSDK-Samples/blob/main/Samples/Input/cs-winui/GestureRecognizer.xaml.cs) — Pointer events with GestureRecognizer +- [GestureRecognizerManipulation.xaml.cs](https://github.com/microsoft/WindowsAppSDK-Samples/blob/main/Samples/Input/cs-winui/GestureRecognizerManipulation.xaml.cs) — Manipulation (drag/scale/rotate) with pointer input diff --git a/hub/apps/develop/launch/launch-the-default-app-for-a-file.md b/hub/apps/develop/launch/launch-the-default-app-for-a-file.md index 663bcdfeed..34dc2512bf 100644 --- a/hub/apps/develop/launch/launch-the-default-app-for-a-file.md +++ b/hub/apps/develop/launch/launch-the-default-app-for-a-file.md @@ -105,7 +105,7 @@ void MainPage::DefaultLaunch() { auto installFolder = Windows::ApplicationModel::Package::Current->InstalledLocation; - concurrency::taskGetFileAsync("images\\test.png")); + concurrency::task getFileOperation(installFolder->GetFileAsync("images\\test.png")); getFileOperation.then([](Windows::Storage::StorageFile^ file) { if (file != nullptr) diff --git a/hub/apps/develop/motion/motion-in-practice.md b/hub/apps/develop/motion/motion-in-practice.md index cc86cc816a..2039bf4fae 100644 --- a/hub/apps/develop/motion/motion-in-practice.md +++ b/hub/apps/develop/motion/motion-in-practice.md @@ -29,7 +29,7 @@ There may be times when the system does not yet provide an exact motion solution :::row::: :::column::: Direction Forward Out:
-Fade out: 150m; Easing: Default Accelerate +Fade out: 150ms; Easing: Default Accelerate Direction Forward In:
Slide up 150px: 300ms; Easing: Default Decelerate :::column-end::: diff --git a/hub/apps/develop/motion/parallax.md b/hub/apps/develop/motion/parallax.md index 8172d33e07..78832fe5ac 100644 --- a/hub/apps/develop/motion/parallax.md +++ b/hub/apps/develop/motion/parallax.md @@ -67,6 +67,7 @@ This example creates a parallax effect for a list: Item 9 Item 10 Item 11 + Item 12 Item 13 Item 14 Item 15 diff --git a/hub/apps/develop/notifications/app-notifications/app-notifications-content.md b/hub/apps/develop/notifications/app-notifications/app-notifications-content.md index ad9df57804..9162d82c01 100644 --- a/hub/apps/develop/notifications/app-notifications/app-notifications-content.md +++ b/hub/apps/develop/notifications/app-notifications/app-notifications-content.md @@ -217,8 +217,8 @@ The images you use in your app notification can be sourced from... For http and https remote web images, there are limits on the file size of each individual image. The limit is 3 MB on normal connections and 1 MB on metered connections. -| Normal connection | Metered connection | -| - | - | +| Normal connection | Metered connection | +| - | - | | 3 MB | 1 MB | If an image exceeds the file size, or fails to download, or times out, the image will be dropped and the rest of the notification will be displayed. @@ -239,7 +239,7 @@ On older versions of Windows that don't support attribution text, the text will var builder = new AppNotificationBuilder() .AddText("Marry Anne") .AddText("Check out where we camped last night!") - .SetAttributionText("via SMS"); + .SetAttributionText("via SMS") .SetHeroImage(new Uri("ms-appx:///Images/HeroImage.png")); ``` diff --git a/hub/apps/develop/notifications/choosing-a-notification-delivery-method.md b/hub/apps/develop/notifications/choosing-a-notification-delivery-method.md index 033aaced18..c8bd947ba7 100644 --- a/hub/apps/develop/notifications/choosing-a-notification-delivery-method.md +++ b/hub/apps/develop/notifications/choosing-a-notification-delivery-method.md @@ -51,7 +51,7 @@ This table summarizes the notification delivery types.
  • A music app updates its tile to show what's "Now Playing".
  • A game app updates its tile with the user's high score when the user leaves the game.
  • -
  • A badge whose glyph indicates that there's new info int the app is cleared when the app is activated.
  • +
  • A badge whose glyph indicates that there's new info in the app is cleared when the app is activated.
diff --git a/hub/apps/develop/notifications/push-notifications/push-quickstart.md b/hub/apps/develop/notifications/push-notifications/push-quickstart.md index 8e1a9d48b4..3aa972ce21 100644 --- a/hub/apps/develop/notifications/push-notifications/push-quickstart.md +++ b/hub/apps/develop/notifications/push-notifications/push-quickstart.md @@ -480,7 +480,7 @@ request.AddHeader("Content-Type", "application/octet-stream"); request.AddHeader("X-WNS-Type", "wns/raw"); request.AddHeader("Authorization", "Bearer [your access token]"); request.AddBody("Notification body"); -RestResponse response = await client.ExecutePostAsync(request);"); +RestResponse response = await client.ExecutePostAsync(request); ``` ### Step 3: Send a cloud-sourced app notification diff --git a/hub/apps/develop/platform/xaml/themeresource-markup-extension.md b/hub/apps/develop/platform/xaml/themeresource-markup-extension.md index db98d45188..c904fe6b71 100644 --- a/hub/apps/develop/platform/xaml/themeresource-markup-extension.md +++ b/hub/apps/develop/platform/xaml/themeresource-markup-extension.md @@ -38,7 +38,7 @@ As with **StaticResource**, a **ThemeResource** must not attempt to make a forwa Attempting to specify a **ThemeResource** to a key that cannot resolve throws a XAML parse exception at run time. Design tools may also offer warnings or errors. -In the Windows Runtime XAML processor implementation, there is no backing class representation for **ThemeResource**. The closest equivalent in code is to use the collection API of a [**ResourceDictionary**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.ResourceDictionary), for example calling **Contains** or **TryGetValue*. +In the Windows Runtime XAML processor implementation, there is no backing class representation for **ThemeResource**. The closest equivalent in code is to use the collection API of a [**ResourceDictionary**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.ResourceDictionary), for example calling **Contains** or **TryGetValue**. **ThemeResource** is a markup extension. Markup extensions are typically implemented when there is a requirement to escape attribute values to be other than literal values or handler names, and the requirement is more global than just putting type converters on certain types or properties. All markup extensions in XAML use the "{" and "}" characters in their attribute syntax, which is the convention by which a XAML processor recognizes that a markup extension must process the attribute. diff --git a/hub/apps/develop/security/third-party.md b/hub/apps/develop/security/third-party.md index 38e11673de..5afdafa247 100644 --- a/hub/apps/develop/security/third-party.md +++ b/hub/apps/develop/security/third-party.md @@ -46,7 +46,7 @@ Windows 11 supports a plugin model for passkeys. Contoso Passkey Manager is a de ### Step 4: Passkey authentication -1. Use the passkey autofill drop down and you will be prompted to complete user verificaition to sign in with you passkey saved to the Contoso Passkey Manager. +1. Use the passkey autofill drop down and you will be prompted to complete user verification to sign in with you passkey saved to the Contoso Passkey Manager. ![A screenshot of authentication with a Contoso Passkey Manager passkey](images/authentication-contoso-passkey-manager.png) diff --git a/hub/apps/develop/testing/index.md b/hub/apps/develop/testing/index.md index 2fa8694ac2..11117500aa 100644 --- a/hub/apps/develop/testing/index.md +++ b/hub/apps/develop/testing/index.md @@ -125,9 +125,9 @@ namespace WinUITest1 11. Open the UserControl1.xaml.cs code-behind file. For this example, we add a new public method called `GetSeven` that simply returns an integer. ```csharp - namespace WinUICLassLibrary1 + namespace WinUIClassLibrary1 { - public sealed partial class UserControll : UserControl + public sealed partial class UserControl1 : UserControl { public UserControl1() { diff --git a/hub/apps/develop/ui/controls/animated-icon.md b/hub/apps/develop/ui/controls/animated-icon.md index 3e6675ae31..1e09dd8351 100644 --- a/hub/apps/develop/ui/controls/animated-icon.md +++ b/hub/apps/develop/ui/controls/animated-icon.md @@ -211,7 +211,7 @@ private void Button_PointerEntered(object sender, PointerRoutedEventArgs e) private void Button_PointerExited(object sender, PointerRoutedEventArgs e) { - AnimatedIcon.SetState(this.StackPaAnimatedIcon1nel1, "Normal"); + AnimatedIcon.SetState(this.AnimatedIcon1, "Normal"); } ``` diff --git a/hub/apps/develop/ui/controls/media-playback.md b/hub/apps/develop/ui/controls/media-playback.md index ac0a846bb6..0cd27e00dd 100644 --- a/hub/apps/develop/ui/controls/media-playback.md +++ b/hub/apps/develop/ui/controls/media-playback.md @@ -311,7 +311,7 @@ For more complex media playback scenarios like playing a playlist, switching bet Use the [Stretch](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.mediaplayerelement.stretch) property to change how the video content and/or the [PosterSource](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.mediaplayerelement.postersource) fills the container it's in. This resizes and stretches the video depending on the [Stretch](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.stretch) value. The `Stretch` states are similar to picture size settings on many TV sets. You can hook this up to a button and allow the user to choose which setting they prefer. -- [None](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.stretch) displays the native resolution of the content in its original size.This can result in some of the video being cropped or black bars at the edges of the video. +- [None](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.stretch) displays the native resolution of the content in its original size. This can result in some of the video being cropped or black bars at the edges of the video. - [Uniform](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.stretch) fills up as much of the space as possible while preserving the aspect ratio and the video content. This can result in horizontal or vertical black bars at the edges of the video. This is similar to wide-screen modes. - [UniformToFill](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.stretch) fills up the entire space while preserving the aspect ratio. This can result in some of the video being cropped. This is similar to full-screen modes. - [Fill](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.stretch) fills up the entire space, but does not preserve the aspect ratio. None of video is cropped, but stretching may occur. This is similar to stretch modes. diff --git a/hub/apps/develop/ui/controls/password-box.md b/hub/apps/develop/ui/controls/password-box.md index 974d6ec904..841ae716e6 100644 --- a/hub/apps/develop/ui/controls/password-box.md +++ b/hub/apps/develop/ui/controls/password-box.md @@ -29,7 +29,7 @@ For more info about choosing the right text control, see the [Text controls](../ - Use a label or placeholder text if the purpose of the password box isn't clear. A label is visible whether or not the text input box has a value. Placeholder text is displayed inside the text input box and disappears once a value has been entered. - Give the password box an appropriate width for the range of values that can be entered. Word length varies between languages, so take localization into account if you want your app to be world-ready. -- Don't put another control right next to a password input box. The password box has a password reveal button for users to verify the passwords they have typed, and having another control right next to it might make users accidentally reveal their passwords when they try to interact with the other control. To prevent this from happening, put some spacing between the password in put box and the other control, or put the other control on the next line. +- Don't put another control right next to a password input box. The password box has a password reveal button for users to verify the passwords they have typed, and having another control right next to it might make users accidentally reveal their passwords when they try to interact with the other control. To prevent this from happening, put some spacing between the password input box and the other control, or put the other control on the next line. - Consider presenting two password boxes for account creation: one for the new password, and a second to confirm the new password. - Only show a single password box for logins. - When a password box is used to enter a PIN, consider providing an instant response as soon as the last number is entered instead of using a confirmation button. diff --git a/hub/apps/develop/ui/controls/scroll-controls.md b/hub/apps/develop/ui/controls/scroll-controls.md index 8e12941093..5171884d1f 100644 --- a/hub/apps/develop/ui/controls/scroll-controls.md +++ b/hub/apps/develop/ui/controls/scroll-controls.md @@ -523,7 +523,7 @@ private void ZoomSlider_ValueChanged(object sender, RangeBaseValueChangedEventAr scrollViewer.ChangeView( horizontalOffset: null, verticalOffset: null, - zoomFactor: (float)e.NewValue)); + zoomFactor: (float)e.NewValue); } } ``` diff --git a/hub/apps/develop/win2d/premultiplied-alpha.md b/hub/apps/develop/win2d/premultiplied-alpha.md index e8fff7d890..e1be74d1ab 100644 --- a/hub/apps/develop/win2d/premultiplied-alpha.md +++ b/hub/apps/develop/win2d/premultiplied-alpha.md @@ -55,11 +55,11 @@ Win2D image effects use a mixture of straight and premultiplied alpha. Some effe The bitmap APIs `GetPixelBytes`, `SetPixelBytes`, `GetPixelColors`, and `SetPixelColors`, do **not** perform any alpha format conversions. They just directly transfer bit values to or from the underlying GPU texture. This allows you to observe what alpha format Win2D is using internally: - Create a drawing session on a rendertarget -- Call `drawingSession.Clear(Colors.Tranparent)` -- `Colors.Tranparent` is defined as R = 255, G = 255, B = 255, A = 0 +- Call `drawingSession.Clear(Colors.Transparent)` +- `Colors.Transparent` is defined as R = 255, G = 255, B = 255, A = 0 - Win2D will convert this value to premultiplied format, yielding R = 0, G = 0, B = 0, A = 0 - Use `GetPixelColors` to read back the contents of the rendertarget -- Observe that it contains premultiplied format RGB = 0, not RGB = 255 like the original straight alpha `Colors.Tranparent` value +- Observe that it contains premultiplied format RGB = 0, not RGB = 255 like the original straight alpha `Colors.Transparent` value ## Converting between alpha formats diff --git a/hub/apps/develop/windows-integration/cross-device-resume.md b/hub/apps/develop/windows-integration/cross-device-resume.md index db77a3548e..63966d73ff 100644 --- a/hub/apps/develop/windows-integration/cross-device-resume.md +++ b/hub/apps/develop/windows-integration/cross-device-resume.md @@ -400,7 +400,7 @@ Every application is different, and it's up to Windows to understand the target ## Intent URIs -URIs allow you to launch another app to perform a specific task, enabling helpful app-to-app scenarios. For more infomation about launching apps using URIs, see [Launch the default Windows app for a URI](/windows/apps/develop/launch/launch-default-app) and [Create Deep Links to App Content | Android Developers](https://developer.android.com/training/app-links/deep-linking). +URIs allow you to launch another app to perform a specific task, enabling helpful app-to-app scenarios. For more information about launching apps using URIs, see [Launch the default Windows app for a URI](/windows/apps/develop/launch/launch-default-app) and [Create Deep Links to App Content | Android Developers](https://developer.android.com/training/app-links/deep-linking). ## Handling API responses in Windows diff --git a/hub/apps/develop/windows-integration/pin-to-taskbar.md b/hub/apps/develop/windows-integration/pin-to-taskbar.md index ab3c63471d..5d5650c35e 100644 --- a/hub/apps/develop/windows-integration/pin-to-taskbar.md +++ b/hub/apps/develop/windows-integration/pin-to-taskbar.md @@ -39,7 +39,7 @@ The [TaskbarManager](/uwp/api/windows.ui.shell.taskbarmanager) class lets you as ### Win32 -If you want to use `TaskbarManager` from your WIn32 desktop app, then you'll need to check whether desktop app support is present. You can look for the `ITaskbarManagerDesktopAppSupportStatics` marker interface on the `TaskbarManager` activation factory to perform this check. If this interface is not available, then you won't be able to use `TaskbarManager` from your desktop app. +If you want to use `TaskbarManager` from your Win32 desktop app, then you'll need to check whether desktop app support is present. You can look for the `ITaskbarManagerDesktopAppSupportStatics` marker interface on the `TaskbarManager` activation factory to perform this check. If this interface is not available, then you won't be able to use `TaskbarManager` from your desktop app. ```cpp if (winrt::try_get_activation_factory()) diff --git a/hub/apps/develop/windows-integration/studio-effects.md b/hub/apps/develop/windows-integration/studio-effects.md index c4df2b1ba7..8de0f3a8d8 100644 --- a/hub/apps/develop/windows-integration/studio-effects.md +++ b/hub/apps/develop/windows-integration/studio-effects.md @@ -127,11 +127,9 @@ private async void Button_Click(object sender, RoutedEventArgs e) // Hard coded for this example, one can use DeviceInformation and/or // MediaCapture VideoDeviceController.Id to get the symbolic link - string symlink = "\\?\USB#VID_04F2&PID_B6B6&MI_00#6&12293a26&1&0000#{e5323777-f976-4f5b-9b55- -b94699c46e44}\GLOBAL"; + string symlink = "\\?\USB#VID_04F2&PID_B6B6&MI_00#6&12293a26&1&0000#{e5323777-f976-4f5b-9b55-b94699c46e44}\GLOBAL"; - bool result = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:camera?cameraId=" + -Uri.EscapeDataString(symlink) )); + bool result = await Windows.System.Launcher.LaunchUriAsync(new Uri("ms-settings:camera?cameraId=" + Uri.EscapeDataString(symlink) )); } ```