Skip to content

Proper Dialog example? #1173

Closed Answered by Racer396
M0n7y5 asked this question in Q&A
Apr 29, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

I don't know, is question still actual, but I got the same error, tried to Google and found only this.
After that, I started researching the source code of the demo.

Simple answer: just set DataContext in your dialog view (UserControl) DataContext = YourViewModel (VM should inherit IDialogResultable/IDialogResultable<T>)

Details: In the demo (I get InteractiveDialog as an example) they do this by DataContext="{Binding InteractiveDialog, Source={StaticResource Locator}}", but IntercativeDialog is here is not view by itself, this is the property in ViewModelLocator, that looks like this:
public InteractiveDialogViewModel InteractiveDialog => SimpleIoc.Default.GetInstance<InteractiveDialogVi…

Replies: 1 comment 1 reply

Comment options

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

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