Facebook Twitter
6: Advanced MVVM Scenarios 6: Advanced MVVM Scenarios The previous chapter described how to implement the basic elements of the Model-View-ViewModel (MVVM) pattern by separating your application's user interface (UI), presentation logic, and business logic into three separate classes (the view, view model, and model), implementing the interactions between those classes (through data binding, commands, and data validation interfaces), and by implementing a strategy to handle construction and wire-up. Implementing the MVVM pattern using these basic elements will likely support many of the scenarios in your application. However, you may encounter more sophisticated scenarios that require the basic MVVM pattern to be extended or that require more advanced techniques to be applied. This is more likely to be true if your application is large or complex, but you may also encounter these scenarios in many smaller applications.
c# - WPF MVVM Modal Overlay Dialog only over a View (not Window) I'm pretty much new to the MVVM architecture design... I was struggling lately to find a suitable control already written for such a purpose but had no luck, so I reused parts of XAML from another similar control and got make my own. What I want to achieve is: Have a reusable View (usercontrol) + viewmodel (to bind to) to be able to use inside other views as a modal overlay showing a dialog that disables the rest of the view, and shows a dialog over the it. How I wanted to implement it: create a viewmodel that takes string(message) and action+string collection(buttons)viewmodel creates a collection of ICommands that call those actionsdialog view binds to the its viewmodel that will be exposed as property of another viewmodel (parent)dialog view is put into the xaml of the parent like this: c# - WPF MVVM Modal Overlay Dialog only over a View (not Window)
In WPF, using the regular window control to launch child windows makes MVVM and separating a View concern from the ViewModel very difficult. The problem: The window control works nicely as a shell for your application, however, launching child windows is problematic because the window control cannot be defined in xaml unless as the root element. So, if you wanted to launch child windows inside a parent window, you lose the ability to declare these in xaml. This loss means you will not be able to bind to properties in your ViewModel from the view for the purpose of opening/closing a window. Custom popup and windows in WPF the MVVM way Custom popup and windows in WPF the MVVM way

MVVM Communication among ViewModels When a new person enters into the MVVM world ,the first doubt in his mind would be ‘How can I achieve messaging among View-Models ? ’or ‘How to notify other ViewModels about a change or operation in one ViewModel ?’ For example if we take a scenario of CRUD database operations there should be notifications passing through on each operation like creation,deletion etc...Otherwise the listing ViewModel will not be up to date. MVVM Communication among ViewModels


THE MODEL-VIEW-VIEWMODEL (MVVM) DESIGN PATTERN FOR WPF Patterns WPF Apps With The Model-View-ViewModel Design Pattern Josh Smith

I’ve been toying with some ideas for MVVM lately. Along the way I have been dragging some friends like Glenn Block and Ward Bell along for the ride. Now, normally its not so bad, but when I get an idea in my head to challenge everything I can be “interesting” to work with :). These guys are great and I highly encourage you all to get your own personal Glenn and Ward bobble head dolls for your home. But back to MVVM … I’ve been exploring the world of View first again. Simple ViewModel Locator for MVVM: The Patients Have Left the Asylum - John Papa Simple ViewModel Locator for MVVM: The Patients Have Left the Asylum - John Papa
<phone:PhoneApplicationPage x:Class="ItemList.MainPage" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:MVVM="clr-namespace:ItemList.ViewModelLocator.Framework.Implementors.Silverlight.MVVM" mc:Ignorable="d" FontFamily="{StaticResource PhoneFontFamilyNormal}" Working with a simple ViewModelLocator from MVVM-Light Working with a simple ViewModelLocator from MVVM-Light
MVVM Animation by DataTrigger Greetings, I would like to visually show when a background process is working. This process happens at a regular intervals (say every 30 seconds), and might take 10ms or 1000ms+ to complete. MVVM Animation by DataTrigger