Skip to content

Custom content for Dialogs #848

Answered by Mithicor
slimshader asked this question in Q&A
Nov 29, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

It is called with the IContentDialogService, which I have declared as _dialogService.

I call it from a method in my Main Viewmodel like so:

var NewContentDialog = new AddUserDialog(_dialogService.GetContentPresenter(), this)
{
    Title = "ADD NEW USER",
    PrimaryButtonText = "CREATE USER",
    SecondaryButtonText = "",
    CloseButtonText = "CANCEL"
};


var result = await NewContentDialog.ShowAsync();

if (result == ContentDialogResult.Primary)
{
    _snackbarService.Show(
                "SUCCESS",
                "A new User was created.",
                ControlAppearance.Success,
                new SymbolIcon(SymbolRegular.Fluent24), TimeSpan.FromSeconds(SnackBarDuration));

    …

Replies: 1 comment 2 replies

Comment options

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

@Mithicor
Comment options

Answer selected by slimshader
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