Skip to content

A tutorial on using ContentDialog #726

Answered by agonzalezrubio
FQMWakeZero asked this question in Q&A
Discussion options

You must be logged in to vote

Im also new to this but there has been some changes. By looking in the Gallery i think i understood a little of how it works.

To show dialogs you have to create and use the service IContentDialogService and set its contentPresenter

XAML
<ContentPresenter x:Name="RootContentDialog" Grid.Row="0" />

CODE
contentDialogService.SetContentPresenter(RootContentDialog);

And as the examples from the gallery, you can show the dialogs like this:

Basic alerts:

var result = await _contentDialogService.ShowAlertAsync("Title", "Message", "Close", cancellationToken);

var result = await _contentDialogService.ShowSimpleDialogAsync(
            new SimpleContentDialogCreateOptions()
            {

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@FQMWakeZero
Comment options

@agonzalezrubio
Comment options

Answer selected by FQMWakeZero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants