Skip to content
DocsTry Aspire
DocsTry

IInteractionService Methods

InterfaceMethods7 members
A service to interact with the current development environment.
PromptConfirmationAsync(string, string, MessageBoxInteractionOptions?, CancellationToken)Section titled PromptConfirmationAsync(string, string, MessageBoxInteractionOptions?, CancellationToken)abstractTask<InteractionResult<bool>>
Prompts the user for confirmation with a dialog.
public interface IInteractionService
{
public abstract Task<InteractionResult<bool>> PromptConfirmationAsync(
string title,
string message,
MessageBoxInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
titlestringThe title of the dialog.
messagestringThe message to display in the dialog.
optionsMessageBoxInteractionOptions?optionalOptional configuration for the message box interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation.
Task<InteractionResult<bool>> An Hosting.InteractionResult`1 containing true if the user confirmed, false otherwise.
PromptInputAsync(string, string?, string, string, InputsDialogInteractionOptions?, CancellationToken)Section titled PromptInputAsync(string, string?, string, string, InputsDialogInteractionOptions?, CancellationToken)abstractTask<InteractionResult<InteractionInput>>
Prompts the user for a single text input.
public interface IInteractionService
{
public abstract Task<InteractionResult<InteractionInput>> PromptInputAsync(
string title,
string? message,
string inputLabel,
string placeHolder,
InputsDialogInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
titlestringThe title of the input dialog.
messagestring?The message to display in the dialog.
inputLabelstringThe label for the input field.
placeHolderstringThe placeholder text for the input field.
optionsInputsDialogInteractionOptions?optionalOptional configuration for the input dialog interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation.
Task<InteractionResult<InteractionInput>> An Hosting.InteractionResult`1 containing the user's input.
PromptInputAsync(string, string?, InteractionInput, InputsDialogInteractionOptions?, CancellationToken)Section titled PromptInputAsync(string, string?, InteractionInput, InputsDialogInteractionOptions?, CancellationToken)abstractTask<InteractionResult<InteractionInput>>
Prompts the user for a single input using a specified InteractionInput.
public interface IInteractionService
{
public abstract Task<InteractionResult<InteractionInput>> PromptInputAsync(
string title,
string? message,
InteractionInput input,
InputsDialogInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
titlestringThe title of the input dialog.
messagestring?The message to display in the dialog.
inputInteractionInputThe input configuration.
optionsInputsDialogInteractionOptions?optionalOptional configuration for the input dialog interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation.
Task<InteractionResult<InteractionInput>> An Hosting.InteractionResult`1 containing the user's input.
PromptInputsAsync(string, string?, IReadOnlyList<InteractionInput>, InputsDialogInteractionOptions?, CancellationToken)Section titled PromptInputsAsync(string, string?, IReadOnlyList<InteractionInput>, InputsDialogInteractionOptions?, CancellationToken)abstractTask<InteractionResult<InteractionInputCollection>>
Prompts the user for multiple inputs.
public interface IInteractionService
{
public abstract Task<InteractionResult<InteractionInputCollection>> PromptInputsAsync(
string title,
string? message,
IReadOnlyList<InteractionInput> inputs,
InputsDialogInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
titlestringThe title of the input dialog.
messagestring?The message to display in the dialog.
inputsIReadOnlyList<InteractionInput>A collection of InteractionInput to prompt for.
optionsInputsDialogInteractionOptions?optionalOptional configuration for the input dialog interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation.
Task<InteractionResult<InteractionInputCollection>> An Hosting.InteractionResult`1 containing the user's inputs as an InteractionInputCollection.
PromptMessageBoxAsync(string, string, MessageBoxInteractionOptions?, CancellationToken)Section titled PromptMessageBoxAsync(string, string, MessageBoxInteractionOptions?, CancellationToken)abstractTask<InteractionResult<bool>>
Prompts the user with a message box dialog.
public interface IInteractionService
{
public abstract Task<InteractionResult<bool>> PromptMessageBoxAsync(
string title,
string message,
MessageBoxInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
titlestringThe title of the message box.
messagestringThe message to display in the message box.
optionsMessageBoxInteractionOptions?optionalOptional configuration for the message box interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation.
Task<InteractionResult<bool>> An Hosting.InteractionResult`1 containing true if the user accepted, false otherwise.
PromptNotificationAsync(string, string, NotificationInteractionOptions?, CancellationToken)Section titled PromptNotificationAsync(string, string, NotificationInteractionOptions?, CancellationToken)abstractTask<InteractionResult<bool>>
Prompts the user with a notification.
public interface IInteractionService
{
public abstract Task<InteractionResult<bool>> PromptNotificationAsync(
string title,
string message,
NotificationInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
titlestringThe title of the notification.
messagestringThe message to display in the notification.
optionsNotificationInteractionOptions?optionalOptional configuration for the notification interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation.
Task<InteractionResult<bool>> An Hosting.InteractionResult`1 containing true if the user accepted, false otherwise.
PromptProgressAsync(string, ProgressInteractionOptions?, CancellationToken)Section titled PromptProgressAsync(string, ProgressInteractionOptions?, CancellationToken)abstractTask<InteractionResult<bool>>
Displays a progress dialog with an indeterminate progress indicator.
public interface IInteractionService
{
public abstract Task<InteractionResult<bool>> PromptProgressAsync(
string message,
ProgressInteractionOptions? options = null,
CancellationToken cancellationToken = default(CancellationToken))
{
// ...
}
}
messagestringThe message to display in the progress dialog.
optionsProgressInteractionOptions?optionalOptional configuration for the progress interaction.
cancellationTokenCancellationTokenoptionalA token to cancel the operation and close the dialog.
Task<InteractionResult<bool>> An Hosting.InteractionResult`1 containing true if the operation completed successfully, or a canceled result if the user clicked the cancel button.

The dialog displays a spinning progress wheel and can optionally include a title, message, and a cancel button.

If ProgressInteractionOptions.Work is provided, the dialog remains open while the callback executes and closes automatically when it completes. If no callback is provided, the dialog remains open until cancellationToken is canceled.

When a button is shown (via InteractionOptions.PrimaryButtonText), clicking it signals cancellation through the ProgressContext.CancellationToken provided to the work callback.