Should we make a compromise?
The preceding discussion might lead you to think that we have no solution to display dialogs in an MVVM fashion or you might think that it's not worth the effort. As we will see there are definitely options and we've already looked at the benefits that will be provided by putting in that extra effort. The MVVM community has devised many different ways to deal with this problem and just like everything in development there are tradeoffs to each approach. In this chapter, we are going to discuss some of these approaches. We will be discussing how we can show both, modal and modeless dialogs with these technique. We will also discuss how these dialogs can return data, which can be used by the view model using these techniques. The options we are going to explore in this chapter are as follows:
Dialog service
Mediators
Attached behavior