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 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)
Just in case you missed it, here is a copy of the database