Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions hub/apps/design/accessibility/custom-automation-peers.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ All classes that derive from [**UIElement**](/windows/windows-app-sdk/api/winrt/

If you are writing a custom control and supplying a custom peer, override [**OnCreateAutomationPeer**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.uielement.oncreateautomationpeer) so it returns a new instance of your peer type. The peer must derive directly or indirectly from [**AutomationPeer**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.Automation.Peers.AutomationPeer).

For example, the following code declares that custom control `NumericUpDown` uses `NumericUpDownPeer` for UI Automation.
For example, the following code declares that custom control `NumericUpDown` uses `NumericUpDownAutomationPeer` for UI Automation.

```csharp
using Microsoft.UI.Xaml.Automation.Peers;
Expand Down Expand Up @@ -200,7 +200,7 @@ End Sub
import "NumericUpDown.idl";
namespace MyNamespace
{
runtimeclass NumericUpDownAutomationPeer : Microsoft.UI.Xaml.Automation.Peers.AutomationPeer
runtimeclass NumericUpDownAutomationPeer : Microsoft.UI.Xaml.Automation.Peers.RangeBaseAutomationPeer
{
NumericUpDownAutomationPeer(NumericUpDown owner);
Int32 MyProperty;
Expand Down
12 changes: 6 additions & 6 deletions hub/apps/design/accessibility/high-contrast-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,12 @@ The following table lists the contrast-theme **SystemColor** resources and recom
|---------|---------|
|:::image source="images/sys-color/aquatic-color-window.png" alt-text="Color swatch of SystemColorWindowColor used for background of pages, panes, popups, and windows.":::| **SystemColorWindowColor**</br>Background of pages, panes, popups, and windows.</br></br>Pair with **SystemColorWindowTextColor** |
|:::image source="images/sys-color/aquatic-color-windowtext.png" alt-text="Color swatch of SystemColorWindowTextColor used for headings, body copy, lists, placeholder text, app and window borders, any UI that can't be interacted with."::: | **SystemColorWindowTextColor**</br>Headings, body copy, lists, placeholder text, app and window borders, any UI that can't be interacted with.</br></br>Pair with **SystemColorWindowColor** |
|:::image source="images/sys-color/aquatic-color-hotlight.png" alt-text="Color swatch of SystemColorWindowTextColor used for hyperlinks.":::| **SystemColorHotlightColor**</br>Hyperlinks.</br></br>Pair with **SystemColorWindowColor** |
|:::image source="images/sys-color/aquatic-color-graytext.png" alt-text="Color swatch of SystemColorWindowTextColor used for inactive or disabled UI.":::| **SystemColorGrayTextColor**</br>Inactive or disabled UI.</br></br>Pair with **SystemColorWindowColor** |
|:::image source="images/sys-color/aquatic-color-highlighttext.png" alt-text="Color swatch of SystemColorWindowTextColor used for foreground color of text or UI that is selected, interacted with (hover, pressed), or in progress.":::| **SystemColorHighlightTextColor**</br>Foreground color of text or UI that is selected, interacted with (hover, pressed), or in progress.</br></br>Pair with **SystemColorHighlightColor** |
|:::image source="images/sys-color/aquatic-color-highlight.png" alt-text="Color swatch of SystemColorWindowTextColor used for background or accent color of UI that is selected, interacted with (hover, pressed), or in progress.":::| **SystemColorHighlightColor**</br>Background or accent color of UI that is selected, interacted with (hover, pressed), or in progress.</br></br>Pair with **SystemColorHighlightTextColor** |
|:::image source="images/sys-color/aquatic-color-btntext.png" alt-text="Color swatch of SystemColorWindowTextColor used for foreground color of buttons and any UI that can be interacted with.":::| **SystemColorButtonTextColor**</br>Foreground color of buttons and any UI that can be interacted with.</br></br>Pair with **SystemColorButtonFaceColor** |
|:::image source="images/sys-color/aquatic-color-3dface.png" alt-text="Color swatch of SystemColorWindowTextColor used for background color of buttons and any UI that can be interacted with.":::| **SystemColorButtonFaceColor**</br>Background color of buttons and any UI that can be interacted with.</br></br>Pair with **SystemColorButtonTextColor** |
|:::image source="images/sys-color/aquatic-color-hotlight.png" alt-text="Color swatch of SystemColorHotlightColor used for hyperlinks.":::| **SystemColorHotlightColor**</br>Hyperlinks.</br></br>Pair with **SystemColorWindowColor** |
|:::image source="images/sys-color/aquatic-color-graytext.png" alt-text="Color swatch of SystemColorGrayTextColor used for inactive or disabled UI.":::| **SystemColorGrayTextColor**</br>Inactive or disabled UI.</br></br>Pair with **SystemColorWindowColor** |
|:::image source="images/sys-color/aquatic-color-highlighttext.png" alt-text="Color swatch of SystemColorHighlightTextColor used for foreground color of text or UI that is selected, interacted with (hover, pressed), or in progress.":::| **SystemColorHighlightTextColor**</br>Foreground color of text or UI that is selected, interacted with (hover, pressed), or in progress.</br></br>Pair with **SystemColorHighlightColor** |
|:::image source="images/sys-color/aquatic-color-highlight.png" alt-text="Color swatch of SystemColorHighlightColor used for background or accent color of UI that is selected, interacted with (hover, pressed), or in progress.":::| **SystemColorHighlightColor**</br>Background or accent color of UI that is selected, interacted with (hover, pressed), or in progress.</br></br>Pair with **SystemColorHighlightTextColor** |
|:::image source="images/sys-color/aquatic-color-btntext.png" alt-text="Color swatch of SystemColorButtonTextColor used for foreground color of buttons and any UI that can be interacted with.":::| **SystemColorButtonTextColor**</br>Foreground color of buttons and any UI that can be interacted with.</br></br>Pair with **SystemColorButtonFaceColor** |
|:::image source="images/sys-color/aquatic-color-3dface.png" alt-text="Color swatch of SystemColorButtonFaceColor used for background color of buttons and any UI that can be interacted with.":::| **SystemColorButtonFaceColor**</br>Background color of buttons and any UI that can be interacted with.</br></br>Pair with **SystemColorButtonTextColor** |

The next table shows practical examples using **SystemColorWindowColor** as the background baseline.

Expand Down
18 changes: 9 additions & 9 deletions hub/apps/design/accessibility/system-button-narration.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ It is common for more than one of the supported events to fire when the Fn butto

3. This third snippet includes the corresponding event handler delegates for each event supported by the [SystemButtonEventController](/uwp/api/windows.ui.input.systembuttoneventcontroller) object.

Each event handler announces the event that has occurred. In addition, the FunctionLockIndicatorChanged handler also controls whether the app is in "Learning" mode (`_isLearningMode` = true), which prevents the event from bubbling to other handlers and lets the user explore keyboard features without actually performing the action.
Each event handler announces the event that has occurred. In addition, the SystemFunctionLockIndicatorChanged handler also controls whether the app is in "Learning" mode (`_isLearningMode` = true), which prevents the event from bubbling to other handlers and lets the user explore keyboard features without actually performing the action.

```cppwinrt
void SetupSystemButtonEventController()
Expand All @@ -80,8 +80,8 @@ It is common for more than one of the supported events to fire when the Fn butto
_controller = winrt::SystemButtonEventController::CreateForDispatcherQueue(_queue);

// Add Event Handler for each different event
_fnKeyDownToken = _controller->FunctionButtonPressed(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: FunctionButtonEventArgs& args)
_fnKeyDownToken = _controller->SystemFunctionButtonPressed(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: SystemFunctionButtonEventArgs& args)
{
// Mock function to read the sentence "Fn button is pressed"
PronounceFunctionButtonPressedMock();
Expand All @@ -90,8 +90,8 @@ It is common for more than one of the supported events to fire when the Fn butto
args.Handled(true);
});

_fnKeyUpToken = _controller->FunctionButtonReleased(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: FunctionButtonEventArgs& args)
_fnKeyUpToken = _controller->SystemFunctionButtonReleased(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: SystemFunctionButtonEventArgs& args)
{
// Mock function to read the sentence "Fn button is up"
PronounceFunctionButtonReleasedMock();
Expand All @@ -100,8 +100,8 @@ It is common for more than one of the supported events to fire when the Fn butto
args.Handled(true);
});

_fnLockToken = _controller->FunctionLockChanged(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: FunctionLockChangedEventArgs& args)
_fnLockToken = _controller->SystemFunctionLockChanged(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: SystemFunctionLockChangedEventArgs& args)
{
// Mock function to read the sentence "Fn shift is locked/unlocked"
PronounceFunctionLockMock(args.IsLocked());
Expand All @@ -110,8 +110,8 @@ It is common for more than one of the supported events to fire when the Fn butto
args.Handled(true);
});

_fnLockIndicatorToken = _controller->FunctionLockIndicatorChanged(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: FunctionLockIndicatorChangedEventArgs& args)
_fnLockIndicatorToken = _controller->SystemFunctionLockIndicatorChanged(
[](const winrt::SystemButtonEventController& /*sender*/, const winrt:: SystemFunctionLockIndicatorChangedEventArgs& args)
{
// Mock function to read the sentence "Fn lock indicator is on/off"
PronounceFunctionLockIndicatorMock(args.IsIndicatorOn());
Expand Down
2 changes: 1 addition & 1 deletion hub/apps/design/layout/boxpanel-example-custom-panel.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Size LimitUnboundedSize(Size input)
{
if (Double.IsInfinity(input.Height))
{
input.Height = maxcellheight * colcount;
input.Height = maxcellheight * rowcount;
cellheight = maxcellheight;
}
return input;
Expand Down
2 changes: 1 addition & 1 deletion hub/apps/desktop/modernize/ui/apply-windows-themes.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ HRESULT DwmSetWindowAttribute(
);
```

After passing `hWnd` (the handle to the window you want to change) as your first parameter, you need to pass in `DWMWA_USE_IMMERSIVE_DARK_MODE` as the `dwAttribute` parameter. This is a constant in the DWM API that lets the Windows frame be drawn in Dark mode colors when the Dark mode system setting is enabled. If you switch to Light mode, you will have to change `DWMWA_USE_IMMERSIVE_DARK_MODE` from 20 to 0 for the title bar to be drawn in light mode colors.
After passing `hWnd` (the handle to the window you want to change) as your first parameter, you need to pass in `DWMWA_USE_IMMERSIVE_DARK_MODE` as the `dwAttribute` parameter. This is a constant in the DWM API that lets the Windows frame be drawn in Dark mode colors when the Dark mode system setting is enabled. If you switch to Light mode, keep `DWMWA_USE_IMMERSIVE_DARK_MODE` unchanged and set the `BOOL` passed through `pvAttribute` to `FALSE` for the title bar to be drawn in light mode colors.

The `pvAttribute` parameter points to a value of type `BOOL` (which is why you made the `BOOL` value earlier). You need `pvAttribute` to be `TRUE` to honor Dark mode for the window. If `pvAttribute` is `FALSE`, the window will use Light Mode.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ In the [**SelectionChanged**](/uwp/api/windows.ui.xaml.controls.primitives.selec

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.ManualControls.xaml.cs" id="SnippetWhiteBalanceComboBox":::

In the **ValueChanged** event handler, get the current value of the control and the set the white balance value by calling [**SetValueAsync**](/uwp/api/windows.media.devices.exposurecontrol.setvalueasync).
In the **ValueChanged** event handler, get the current value of the control and the set the white balance value by calling [**SetValueAsync**](/uwp/api/windows.media.devices.whitebalancecontrol.setvalueasync).

:::code language="csharp" source="~/../snippets-windows/winappsdk/audio-video-camera/camera-winui/CS/CameraWinUI/MainWindow.ManualControls.xaml.cs" id="SnippetWhiteBalanceSlider":::

Expand Down
2 changes: 1 addition & 1 deletion hub/apps/develop/composition/pointer-input-animations.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Let's take a look at an example where we leverage the Hover position of a Mouse
The image is a UIElement, so let's first get a reference to the PointerPositionPropertySet

```csharp
_pointerPositionPropSet = ElementCompositionPreview.GetPointerPositionPropertySet(UIElement element);
_pointerPositionPropSet = ElementCompositionPreview.GetPointerPositionPropertySet(element);
```

In this sample, you have two Expressions at play:
Expand Down
6 changes: 3 additions & 3 deletions hub/apps/develop/data-access/sqlite-data-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ This tutorial shows you how to integrate SQLite into your WinUI application usin

In this tutorial, you'll learn how to:

- Configure your Windows app to use SQLite with the Microsoft.Data.SQLite library
- Configure your Windows app to use SQLite with the Microsoft.Data.Sqlite library
- Create and initialize a local database
- Implement secure data insertion and retrieval methods
- Build a simple user interface to interact with your data
Expand Down Expand Up @@ -74,7 +74,7 @@ The [Microsoft.Data.Sqlite](/dotnet/api/microsoft.data.sqlite) library implement

The rest of this guide helps you to use this library.

## Set up your solution to use the Microsoft.Data.SQLite library
## Set up your solution to use the Microsoft.Data.Sqlite library

We'll start with a basic WinUI project, and then install the SQLite NuGet package. See [Create a WinUI app](/windows/apps/tutorials/winui-notes/intro) for instructions on how to create your first WinUI project.

Expand All @@ -94,7 +94,7 @@ Let's start by adding a class to your project named **DataAccess**. If you plan

At this point, you have a choice. You can use the version of SQLite that is included with Windows or if you have some reason to use a specific version of SQLite, you can include the SQLite library in your package. We are going to use the version of SQLite that's included with Windows.

1. Choose the **Browse** tab, search for the **Microsoft.Data.SQLite** package, and then install the latest stable version.
1. Choose the **Browse** tab, search for the **Microsoft.Data.Sqlite** package, and then install the latest stable version.

![SQLite NuGet package](images/sqlite-nuget-package.png)

Expand Down
2 changes: 1 addition & 1 deletion hub/apps/develop/data/store-and-retrieve-app-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ localSettings.DeleteContainer("exampleContainer");
## Versioning your app data


You can optionally version the app data for your app. This would enable you to create a future version of your app that changes the format of its app data without causing compatibility problems with the previous version of your app. The app checks the version of the app data in the data store, and if the version is less than the version the app expects, the app should update the app data to the new format and update the version. For more info, see the[**Application.Version**](/uwp/api/windows.storage.applicationdata.version) property and the [**ApplicationData.SetVersionAsync**](/uwp/api/windows.storage.applicationdata.setversionasync) method.
You can optionally version the app data for your app. This would enable you to create a future version of your app that changes the format of its app data without causing compatibility problems with the previous version of your app. The app checks the version of the app data in the data store, and if the version is less than the version the app expects, the app should update the app data to the new format and update the version. For more info, see the [**ApplicationData.Version**](/uwp/api/windows.storage.applicationdata.version) property and the [**ApplicationData.SetVersionAsync**](/uwp/api/windows.storage.applicationdata.setversionasync) method.

## Related articles

Expand Down
2 changes: 1 addition & 1 deletion hub/apps/develop/devices-and-sensors.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This article provides an index of development features that are related to scena

## Windows OS features

Windows 10 and later OS releases provide a wide variety of APIs related to data and files scenarios for apps. These features are available via a combination of WinRT and Win32 (C++ and COM) APIs provided by the [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-sdk).
Windows 10 and later OS releases provide a wide variety of APIs related to devices and sensors scenarios for apps. These features are available via a combination of WinRT and Win32 (C++ and COM) APIs provided by the [Windows SDK](https://developer.microsoft.com/windows/downloads/windows-sdk).

#### WinRT APIs

Expand Down
4 changes: 2 additions & 2 deletions hub/apps/develop/dispatcherqueue.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ms.localizationpriority: high
* It provides a means to register a delegate that's called when a timeout expires.
* It provides events that let components know when a message loop is exiting, and optionally defer that shutdown until outstanding work completes. That ensures components that use the **DispatcherQueue**, but don't own the message loop, may do cleanup on-thread as the loop exits.
* The **DispatcherQueue** is a thread singleton (there can be at most one of them running on any given thread). By default, a thread has no **DispatcherQueue**.
* A thread owner may create a [DispatcherQueueController](/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueuecontroller) to initialize the **DispatcherQueue** for the thread. At that point, any code can access the thread's **DispatcherQueue**; but only the **DispatcherQueueController**'s owner has access to the [DispatcherQueueController.ShutdownQueue](/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueuecontroller.shutdownqueue) method, which drains the **DispatcherQueue**, and raises **ShutdownStarted** and **ShutdownCompleted** events.
* A thread owner may create a [DispatcherQueueController](/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueuecontroller) to initialize the **DispatcherQueue** for the thread. At that point, any code can access the thread's **DispatcherQueue**; but only the **DispatcherQueueController**'s owner has access to the [DispatcherQueueController.ShutdownQueue](/windows/windows-app-sdk/api/winrt/microsoft.ui.dispatching.dispatcherqueuecontroller.shutdownqueue) method, which drains the **DispatcherQueue**, and raises **ShutdownStarting** and **ShutdownCompleted** events.
* An outermost message loop owner must create a **DispatcherQueue** instance. Only the code in charge of running a thread's outermost message loop knows when dispatch is complete, which is the appropriate time to shut down the **DispatcherQueue**. That means that components that rely on **DispatcherQueue** mustn't create the **DispatcherQueue** unless they own the thread's message loop.

## Run-down
Expand Down Expand Up @@ -166,7 +166,7 @@ void Main()
// Create a Windows App SDK DispatcherQueue.
auto dispatcherQueueController{winrt::DispatcherQueueController::CreateOnCurrentThread()};

var appWindow = AppWindow.Create(nullptr, 0, dispatcherQueueController.DispatcherQueue());
auto appWindow = AppWindow::Create(nullptr, 0, dispatcherQueueController.DispatcherQueue());

// Since we associated the DispatcherQueue above with the AppWindow, we're able to retrieve it
// as a property. If we were to not associate a dispatcher, this property would be null.
Expand Down
Loading