Let’s go further. When we are speaking about WPF we mean MVVM pattern and vice versa. What is MVVM? It is a concept that is derived from Model-View-Presenter (Model-View-Controller) pattern. There are several great articles about it, for example, I’d recommend this one and this one. AFAIK, there are two featured MVVM frameworks: GalaSoft MVVMLight & Caliburn, both of them are targeting WPF & Silverlight. I chose the first one, MVVMLight, as a base for my application because it is said that the framework supports designing in Blend, and that’s what I want.
So, I installed MVVMLight and created a new project based on MVVMLight WPF Template, added HostViewModel class, which describes the required information about a host and its health, and MainViewModel class that contains a collection of HostViewModel instances and a pair of commands, Start & Stop, which are derived from RelayCommand. After that I adapted the above-mentioned “Screen_1.xaml” from the sketch project. Here it is:
For now, commands do nothing and the hosts information is static rather than live. Nevertheless, after a short period of work I’ve got a prototype that is written on WPF & MVVM and even shows something.
So, the UI part of the requirements is almost done. In the next posts I’ll try creating a Ping service and make use of it with the help of Start and Stop commands.
By the way, it's a good idea to have a special guy in a team whose responsibilities is just to draw XAML forms and controls in expression blend. We already have one and are looking to another one :)
ReplyDeleteOK, I know where to apply for a job after I get more familiar with the tool =)
ReplyDelete