Looking into various MVVM frameworks for SL. In the Caliburn documentation I saw a code in a controller that calls MessageBox. Is this right or is this just for intro? Is there something like MessageBox service in Caliburn like in Chinch MVVM?
相关问题
- ObservableCollection in ViewModel is not updated w
- Is it possible to send a List<Object> in MVV
- How to make an element reference a StaticResource
- Get the selected items of a ListView (MVVM, Calibu
- How to include MaterialDesignXamlToolkit to WPF cl
相关文章
- Best way to implement MVVM bindings (View <-> V
- Using LiveData to set visibility of TextView
- app:visibleGone cannot resolve on android Databind
- WPF MVVM two-way updates
- Difference between Set() and RaisePropertyChanged(
- Generating interface implementation at runtime
- MVVM, Confused about ViewModelLocator and DataTemp
- WPF + Castle Windsor + MVVM: Locator-DataContext
It's indeed introductive code, just to demonstrate that the controller method is actually executed. Yet, I agree on the issue you pointed out: the presence of raw UI code in the presenter could lead to an inappropriate mix of view concerns.
About the MessageBox service: in Caliburn v2 (trunk), ShellFramework module, there is a Question/Answer ViewModel abstracting the functionality of a MessageBox, with the advantage of letting you to design the UI for the dialog. Also, it's very straightforward to roll your own IMessageBox abstraction and provide a basic implementation using the default WPF MessageBox.
Marco is correct. This is just to demonstrate that the action is called. I wouldn't recommend this in practice. I will try to make some changes to the samples or add some comments that make this clearer. Caliburn has services built-in for calling custom message boxes.