Finally I managed to spare some time and build a WPF sample application to showcase the use of MVVM + Mediator and also how AttachedCommandBehaviours can be used to further reduce (or better eliminate) C# code in XAML code behind files. I am also using one of my favorite WPF libraries FluidKit. In the app I create my own 3D transition for the FluidKit TransitionPresenter (I will be posting a whole post on this).
I will be posting at least 4 posts
– MVVM
– MVVM and the Mediator pattern
– FluidKit CoverFlow and FluidKit TransitionPresenter
– Using AttachedCommandBehaviours
Here are some teaser screenshots of the application in action š
Setup of application environment
This application uses a SQL Database so you will need an instance of SqlServer 2005 running (you can use SqlServer Express).
I packaged the database as a backup so all you need to do is restore the database from the SqlServer Management Studio Express (this is your easiest option). If you donāt have this I suggest you download it, itās free.
To restore the database file (WPFDisciplesDB.bak) follow these steps
– First of all download the database file from here.
– Right click on the Databases folder in the SQL Server Management Studio Express and select Restore database
This will open a dialog for you. In the Restore Database dialog enter a name for the database in the āTo databaseā text field > Select āFrom deviceā radio button and browse for the WPFDisciples.bak that you downloaded. The file will appear in the list. Tick the checkbox (which is un checked by default) and press ok.
Now that we have our database set up all we need to do is specify in the app.config the connection string of the new database and we are done.
Stayed tuned because this should be real fun š
aaaa I nearly forgotā¦ The data in the database is not the full versionā¦ I will add more projects from the mighty WPF Disciples as time goes byā¦. Will continue updating the download link here (and put a comment or something to show you that I updated the db version)
Download Full Source Code from HERE
Just in case you missed it, here is a copy of the database