Skip to content

How to set XamlRoot for ContentDialog when using C# Markup + MVUX #18598

Discussion options

You must be logged in to vote

Hey @liziyu0714,

Thanks for your question! I recommend creating a custom service that you initialize with a XamlRoot (e.g., from App.cs during startup). Once the app loads, this service can provide the value whenever you call it. For more details on opening a ContentDialog from a ViewModel, check out this guide: https://platform.uno/docs/articles/features/dialogs.html?tabs=mvux%2Ccs-markup#opening-a-contentdialog-from-a-modelviewmodel
Let me know if this helps.

Replies: 4 comments 11 replies

Comment options

You must be logged in to vote
8 replies
@DevTKSS
Comment options

@liziyu0714
Comment options

@DevTKSS
Comment options

@morning4coffe-dev
Comment options

@DevTKSS
Comment options

Answer selected by liziyu0714
Comment options

You must be logged in to vote
1 reply
@morning4coffe-dev
Comment options

Comment options

You must be logged in to vote
1 reply
@DevTKSS
Comment options

Comment options

You must be logged in to vote
1 reply
@DevTKSS
Comment options

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