开发者

WPF MVVM DialogService close modal dialog?

开发者 https://www.devze.com 2023-03-10 23:25 出处:网络
I use the MVVM-pattern in my WPF-application. Now I show a dialog with my dialogService: _dialogService.ShowDialog(Me, settingsViewModel)

I use the MVVM-pattern in my WPF-application. Now I show a dialog with my dialogService:

_dialogService.ShowDialog(Me, settingsViewModel)

The mapping (which view should be shown to this ViewModel) was set in the WindowViewModelMappings class.

My question is now: How can I close the dialog from the开发者_开发知识库 settingsViewModel?

Thank you..


Without knowing more about the implementation, I'd recommend you to return a token (guid, ...), that represents that dialog. And then you have a call to close the dialog where you pass in that token.

0

精彩评论

暂无评论...
验证码 换一张
取 消