Freigeben über


ISuggestedAction.GetPreviewAsync(CancellationToken) Method

Definition

Gets an object visually representing a preview of the suggested action.

public:
 System::Threading::Tasks::Task<System::Object ^> ^ GetPreviewAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<object> GetPreviewAsync (System.Threading.CancellationToken cancellationToken);
public System.Threading.Tasks.Task<object?> GetPreviewAsync (System.Threading.CancellationToken cancellationToken);
abstract member GetPreviewAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public Function GetPreviewAsync (cancellationToken As CancellationToken) As Task(Of Object)

Parameters

cancellationToken
CancellationToken

A cancellation token that allows to cancel preview creation.

Returns

A task whose result is an object visually representing a preview of the suggested action, or null if no preview can be provided.

Remarks

The only currently supported type of preview object is UIElement.

By default preview panel gets highlighted when focused by setting background color to PreviewFocusBackgroundBrush. When providing a preview object make sure it doesn't set different background for the whole preview content, otherwise it's recommended that preview object indicates focused state using PreviewFocusBackgroundBrush color.

Applies to