Archive | Programming RSS for this section

Close a WPF View while abiding to the MVVM pattern

I want to start by saying that i am a total WPF using MVVM pattern newbie, but im getting the hang of it after working for a while with WPF and the MVVM pattern.

But i have to say its sometimes really hard to move eventhandlers from the views codebind to the viewmodel. Especialy when it commes to the Close method.My first thought was i could send the window as  an param to a command in the viewmodel but then that breaks the MVVM pattern and we cant be having that people.

Because you see, in the MVVM (Model – View – View Model) design pattern, the ViewModel (a class that typically contains the values you want to display in your View) shouldn’t know anything about the View.  However the view can and has to be aware of the ViewModel. But finally it came to me how i could implement the close eventhandler.

And i have to say i never thought it could be so hard to move an eventhandler like the one bellow from the views codebehind to the ViewModel:

private void  Close_Click(object sender, RoutedEventArgs e)
{
    this.Close();
}

Read More…

Advertisements

The “Big-Bang” Software development lifecycle model

Since i have had a lot of free time these last days i have spent the time reading about all kinds of subjects and one of the subjects was the “Big-Bang” lifecycle model.

First of all lets start with a short explanation of what a software development lifecycle model is. Simply put it is the process used to create a software product from its initial conception to its public releases. There are many different methods that can be used for developing software, and no model is necessarily the best for a particular project. But there are four frequently used models:

  • BigBang Model
  • Waterfall Model
  • Prototype Model
  • Spiral Model

Read More…

Pex and Moles – Automated Whitebox Testing for .NET

Pex and Moles basics

Now some of you might be thinking what is Pex and how can a Mole help me test anything. Well Pex is a testing tool which helps you generate unit tests. And when i say Moles i am not thinking about the animal instead i am thinking about a framework which enables you to isolate parts which are tested from other application layers.

Pex is a tool which can help you generate inputs for your unit tests. To use Pex you have to be writing Parameterized Unit Tests. Parameterized Unit Tests are simple tests which accept parameters and Pex helps you generate these parameters automatically.

Read More…