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
2 changes: 1 addition & 1 deletion hub/apps/develop/data-access/sqlite-data-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ public static List<string> GetData()

The [Read](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.read#Microsoft_Data_Sqlite_SqliteDataReader_Read) method advances through the rows of returned data. It returns `true` if there are rows left, otherwise it returns `false`.

The [GetString](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getstring#Microsoft_Data_Sqlite_SqliteDataReader_GetString_System_Int32_) method returns the value of the specified column as a string. It accepts an integer value that represents the zero-based column ordinal of the data that you want. You can use similar methods such as [GetDataTime](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getdatetime#Microsoft_Data_Sqlite_SqliteDataReader_GetDateTime_System_Int32_) and [GetBoolean](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getboolean#Microsoft_Data_Sqlite_SqliteDataReader_GetBoolean_System_Int32_). Choose a method based on what type of data the column contains.
The [GetString](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getstring#Microsoft_Data_Sqlite_SqliteDataReader_GetString_System_Int32_) method returns the value of the specified column as a string. It accepts an integer value that represents the zero-based column ordinal of the data that you want. You can use similar methods such as [GetDateTime](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getdatetime#Microsoft_Data_Sqlite_SqliteDataReader_GetDateTime_System_Int32_) and [GetBoolean](/dotnet/api/microsoft.data.sqlite.sqlitedatareader.getboolean#Microsoft_Data_Sqlite_SqliteDataReader_GetBoolean_System_Int32_). Choose a method based on what type of data the column contains.

The ordinal parameter isn't as important in this example because we are selecting all of the entries in a single column. However, if multiple columns are part of your query, use the ordinal value to obtain the column you want to pull data from.

Expand Down
2 changes: 1 addition & 1 deletion hub/apps/develop/dispatcherqueue.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ void RunCustomMessageLoop()
{
if (!ContentPreTranslateMessage(&msg))
{
TranslateMesasge(&msg);
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
Expand Down
6 changes: 3 additions & 3 deletions hub/apps/develop/files/pickers-save-file.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ Before you start, make sure you have:
The following APIs are used in this topic:

- [FileSavePicker](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker)
- [StorageFile](/uwp/api/Windows.Storage.StorageFile)
- [PickFileResult](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.pickfileresult)

Use the [FileSavePicker](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker) to allow users to specify the name and location where they want your app to save a file.

## Save a document with FileSavePicker

Use a [FileSavePicker](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker) so that your users can specify the name, type, and location of a file to save. Create, customize, and show a file picker object, and then save data via the returned [StorageFile](/uwp/api/Windows.Storage.StorageFile) object that represents the file picked.
Use a [FileSavePicker](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker) so that your users can specify the name, type, and location of a file to save. Create, customize, and show a file picker object, and then save data by using the returned [PickFileResult](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.pickfileresult), which contains the picked file path. If you need the file name, derive it from that path.

1. Create and customize the FileSavePicker. Start by creating a new [FileSavePicker](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker) object, and then set properties on the object to customize the file picker for your app and your users:

Expand Down Expand Up @@ -122,7 +122,7 @@ Use the [FileTypeChoices](/windows/windows-app-sdk/api/winrt/microsoft.windows.s
> [!NOTE]
> [FileSavePicker](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker) objects display the file picker using the [PickerViewMode.List](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.pickerviewmode) view mode.

2. Next, show the **FileSavePicker** and save to the picked file location. Display the file picker by calling [PickSaveFileAsync](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker.picksavefileasync). After the user specifies the name, file type, and location, and confirms to save the file, **PickSaveFileAsync** returns a lightweight [FilePickResult](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.pickfileresult) object that contains the path to the saved file and the filename. You can capture and process this file if you have read and write access to it.
2. Next, show the **FileSavePicker** and save to the picked file location. Display the file picker by calling [PickSaveFileAsync](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.filesavepicker.picksavefileasync). After the user specifies the name, file type, and location, and confirms to save the file, **PickSaveFileAsync** returns a lightweight [PickFileResult](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.pickfileresult) object that contains the path to the saved file. If you need the file name, derive it from that path. You can capture and process this file if you have read and write access to it.

```csharp
using Microsoft.Windows.Storage.Pickers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Create a new instance of **MediaSource** by calling one of the factory methods e

After creating a **MediaSource** you can play it with a [**MediaPlayer**](/uwp/api/Windows.Media.Playback.MediaPlayer) by setting the [**Source**](/uwp/api/windows.media.playback.mediaplayer.source) property. You can assign a **MediaPlayer** to a [**MediaPlayerElement**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.mediaplayerelement) by calling [**SetMediaPlayer**](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.controls.mediaplayerelement.setmediaplayer) in order to render the media player content in a XAML page. This is the preferred method over using **MediaElement**. For more information on using **MediaPlayer**, see [**Play audio and video with MediaPlayer**](play-audio-and-video-with-mediaplayer.md).

The following example shows how to play back a user-selected media file in a **MediaPlayer** using **MediaSource**. To allow the user to pick a media file to play, use a [**FileOpenPicker**](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker). Create an instance of [**StorageFile**](/uwp/api/Windows.Storage.StorageFile) from the path returned from the picker's [**PickSingleFileAsync**](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker.picksinglefileasync) method and initialize a new **MediaSource** object by calling [**MediaSource.CreateFromStorageFile**](/uwp/api/windows.media.core.mediasource.createfromstoragefile). Finally, set the media source as the playback source for the **MediaPlayer** by setting the [**SetPlaybackSource**](/uwp/api/windows.media.playback.mediaplayer.source) property.
The following example shows how to play back a user-selected media file in a **MediaPlayer** using **MediaSource**. To allow the user to pick a media file to play, use a [**FileOpenPicker**](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker). Create an instance of [**StorageFile**](/uwp/api/Windows.Storage.StorageFile) from the path returned from the picker's [**PickSingleFileAsync**](/windows/windows-app-sdk/api/winrt/microsoft.windows.storage.pickers.fileopenpicker.picksinglefileasync) method and initialize a new **MediaSource** object by calling [**MediaSource.CreateFromStorageFile**](/uwp/api/windows.media.core.mediasource.createfromstoragefile). Finally, set the media source as the playback source for the **MediaPlayer** by setting the [**Source**](/uwp/api/windows.media.playback.mediaplayer.source) property.

:::code language="xml" source="~/../snippets-windows/winappsdk/audio-video-camera/media-source-winui/cs/MediaSourceWinUI/MainWindow.xaml" id="SnippetMediaPlayerElement":::

Expand Down
2 changes: 1 addition & 1 deletion hub/apps/develop/ui/controls/animated-icon.md
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
```

Expand Down
2 changes: 1 addition & 1 deletion hub/apps/develop/ui/sound.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ The **ElementSoundMode** has two states: **Off** and **Default**. When not set,
```

```C#
ButtonName.ElementSoundState = ElementSoundMode.Off;
ButtonName.ElementSoundMode = ElementSoundMode.Off;
```

## Is this the right sound?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Instancing behavior in the Windows App SDK is based on UWP's model, class, but w
### AppInstance class

- **UWP**: The [Windows.ApplicationModel.AppInstance](/uwp/api/windows.applicationmodel.appinstance) class is focused purely on instance redirection scenarios.
- **Windows App SDK**: The [Microsoft.Windows.AppLifeycle.AppInstance](/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance) class supports instance redirection scenarios, and contains additional functionality to support new features in later releases.
- **Windows App SDK**: The [Microsoft.Windows.AppLifecycle.AppInstance](/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance) class supports instance redirection scenarios, and contains additional functionality to support new features in later releases.

### List of instances

Expand Down Expand Up @@ -405,7 +405,7 @@ void CALLBACK OnFileClosed(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam

### Instance information

The [Microsoft.Windows.AppLifeycle.AppInstance](/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance) class represents a single instance of an app. In the current preview, `AppInstance` only includes the methods and properties necessary to support activation redirection. In later releases, `AppInstance` will expand to include other methods and properties relevant to an app instance.
The [Microsoft.Windows.AppLifecycle.AppInstance](/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance) class represents a single instance of an app. In the current preview, `AppInstance` only includes the methods and properties necessary to support activation redirection. In later releases, `AppInstance` will expand to include other methods and properties relevant to an app instance.

```cpp
void DumpExistingInstances()
Expand All @@ -424,4 +424,4 @@ void DumpExistingInstances()

[Create a single-instanced WinUI app](applifecycle-single-instance.md)

[Microsoft.Windows.AppLifeycle.AppInstance](/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance)
[Microsoft.Windows.AppLifecycle.AppInstance](/windows/windows-app-sdk/api/winrt/microsoft.windows.applifecycle.appinstance)
4 changes: 2 additions & 2 deletions hub/apps/windows-app-sdk/applifecycle/background-tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ static partial class ComServer
out uint registrationToken);

[LibraryImport("ole32.dll")]
public static partial int CoRevokeObject(out uint registrationToken);
public static partial int CoRevokeClassObject(uint registrationToken);

public const uint CLSCTX_LOCAL_SERVER = 4;
public const uint REGCLS_MULTIPLEUSE = 1;
Expand Down Expand Up @@ -398,7 +398,7 @@ public App()

~App()
{
ComServer.CoRevokeObject(out _RegistrationToken);
ComServer.CoRevokeClassObject(_RegistrationToken);
}
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ There isn't a 1:1 mapping of functionality and behavior from UWP app window pres

### Compact overlay

If you used UWP's **ApplicationViewMode** or **AppWindowPresentionKind** to present a compact overlay window, then you should use the compact overlay **AppWindowPresenterKind**. The [**Microsoft.UI.Windowing.CompactOverlayPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.compactoverlaypresenter) supports only three fixed window sizes at a 16:9 aspect ratio, and can't be resized by the user. Instead of **ApplicationViewMode.TryEnterViewModeAsync** or **AppWindowPresenterKind.RequestPresentation**, you should use [**AppWindow.SetPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.setpresenter#Microsoft_UI_Windowing_AppWindow_SetPresenter_Microsoft_UI_Windowing_AppWindowPresenter_) to change the presentation of the **AppWindow**.
If you used UWP's **ApplicationViewMode** or **AppWindowPresentationKind** to present a compact overlay window, then you should use the compact overlay **AppWindowPresenterKind**. The [**Microsoft.UI.Windowing.CompactOverlayPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.compactoverlaypresenter) supports only three fixed window sizes at a 16:9 aspect ratio, and can't be resized by the user. Instead of **ApplicationView.TryEnterViewModeAsync** or **AppWindowPresenter.RequestPresentation**, you should use [**AppWindow.SetPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.setpresenter#Microsoft_UI_Windowing_AppWindow_SetPresenter_Microsoft_UI_Windowing_AppWindowPresenter_) to change the presentation of the **AppWindow**.

|UWP ApplicationView/CoreWindow|UWP AppWindow|Windows App SDK|
|-|-|-|
|[**ApplicationViewMode.CompactOverlay**](/uwp/api/windows.ui.viewmanagement.applicationviewmode)|[**AppWindowPresentationKind.CompactOverlay**](/uwp/api/windows.ui.windowmanagement.appwindowpresentationkind)|[**AppWindowPresenterKind.CompactOverlay**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindowpresenterkind)|
|[**ApplicationView.TryEnterViewModeAsync**](/uwp/api/windows.ui.viewmanagement.applicationview.tryenterviewmodeasync) with **ApplicationViewMode.CompactOverlay**|[**AppWindowPresenter.RequestPresentation**](/uwp/api/windows.ui.windowmanagement.appwindowpresenter.requestpresentation#Windows_UI_WindowManagement_AppWindowPresenter_RequestPresentation_Windows_UI_WindowManagement_AppWindowPresentationKind_) with **AppWindowPresenterKind.CompactOverlay**|[**AppWindow.SetPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.setpresenter#Microsoft_UI_Windowing_AppWindow_SetPresenter_Microsoft_UI_Windowing_AppWindowPresenterKind_) with **AppWindowPresenterKind.CompactOverla**y|
|[**ApplicationView.TryEnterViewModeAsync**](/uwp/api/windows.ui.viewmanagement.applicationview.tryenterviewmodeasync) with **ApplicationViewMode.CompactOverlay**|[**AppWindowPresenter.RequestPresentation**](/uwp/api/windows.ui.windowmanagement.appwindowpresenter.requestpresentation#Windows_UI_WindowManagement_AppWindowPresenter_RequestPresentation_Windows_UI_WindowManagement_AppWindowPresentationKind_) with **AppWindowPresenterKind.CompactOverlay**|[**AppWindow.SetPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.setpresenter#Microsoft_UI_Windowing_AppWindow_SetPresenter_Microsoft_UI_Windowing_AppWindowPresenterKind_) with **AppWindowPresenterKind.CompactOverlay**|

### Full-screen

If you used UWP's **ApplicationViewWindowingMode** or **AppWindowPresentionKind** classes to present a full-screen window, then you should use the full-screen **AppWindowPresenterKind**. The Windows App SDK supports only the most restrictive full-screen experience (that is, when **FullScreen** is **IsExclusive**). For **ApplicationView**/**CoreWindow**, you can use the [**ApplicationView.ExitFullScreenMode**](/uwp/api/windows.ui.viewmanagement.applicationview.exitfullscreenmode) to take the app out of full-screen. When using presenters, you can take an app out of full-screen by setting the presenter back to overlapped/default by using [**AppWindow.SetPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.setpresenter#Microsoft_UI_Windowing_AppWindow_SetPresenter_Microsoft_UI_Windowing_AppWindowPresenterKind_).
If you used UWP's **ApplicationViewWindowingMode** or **AppWindowPresentationKind** classes to present a full-screen window, then you should use the full-screen **AppWindowPresenterKind**. The Windows App SDK supports only the most restrictive full-screen experience (that is, when **FullScreen** is **IsExclusive**). For **ApplicationView**/**CoreWindow**, you can use the [**ApplicationView.ExitFullScreenMode**](/uwp/api/windows.ui.viewmanagement.applicationview.exitfullscreenmode) to take the app out of full-screen. When using presenters, you can take an app out of full-screen by setting the presenter back to overlapped/default by using [**AppWindow.SetPresenter**](/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.setpresenter#Microsoft_UI_Windowing_AppWindow_SetPresenter_Microsoft_UI_Windowing_AppWindowPresenterKind_).

|UWP ApplicationView/CoreWindow|UWP AppWindow|Windows App SDK|
|-|-|-|
Expand Down