But the fun part was cranking a couple of brand new controls to build the Material Design time picker experience:
TimePicker
Clock
These are sibling controls to the existing DatePicker and Calendar controls. I wanted to keep the API experience similar so you can dive straight in without any kind of learning curve. The Clock can be used in isolation, or use the DatePicker for an easy picker/popup/drop down behaviour.
Here’s a static glimpse at the picker:
And here’s a gif of the clock in action:
There’s nothing complicated about using these, but you will need to get Material Design In XAML Toolkit referenced and set up in your app. Follow the initial tutorial, and head over to GitHub to download the source/examples project.
I have previously posted about the Material Design theme for Dragablz. In this post I will describe how I arrived at this application mock-up, by combining Dragablz, Material Design in XAML Toolkit, and MahApps:
Material Design Demo
My initial task when creating that style was to create a separate, and composable way to define the Material Design colour palette for your application. Making the separation between the colours and the Dragablz Material Design theme immediately paid benefit. Being a big fan of MahApps and I was easily able to take things a step further and use the palette in conjunction with a MahApps MetroWindow. Encouraging MahApps to pick up my Material Design palette turned out to be easy because of the way the MahApps guys had also separated out their accents. Very quickly, I had a MahApps MetroWindow up and running, using MahApps themed controls, the Dragablz Material Design theme, and all of which were using the Material Design palette. It looked pretty good straight away.
I’ve previously posted on how to choose a Material Design palette, but for a refresher, take a look at this App.xaml.
In addition to the Material Design palette, you need to set a base theme; light or dark. So add this resource dictionary to your App.xaml:
Getting MahApps to use the Material Design palette only takes a few extra lines in your App.xaml. Firstly, merge in some of the usual MahApps dictionaries:
Then, where you specify the primary Material Design colour, setup the MahApps brushes, but instead of pulling in one of the MahApps accent dictionaries, configure them manually, to use the Material Design palette:
Any controls added to your Window (or Dragablz TabablzControl) will now default to MahApps styles, but use the Material Design palette, leaving your application looking pretty good. Having got to this point myself, I couldn’t help but start playing around a bit further with some Material Design. I created a list box with a few cards and the result looked pretty promising:
It wasn’t long before I went even further and started styling a whole bunch of controls, and ended up with these:
I’ve packaged all these themes (and will continue to add to) on NuGet:
Install-Package MaterialDesignThemes
Where appropriate in your app you can include one or more of the contained resource dictionaries and use the Material Design style for a control in place of the MahApps. All of your other controls will still use the MahApps themes, meaning your application should always look great. A thorough-bred mash-up 🙂
To select the appropriate resource dictionary and style name the best thing to do is download the source/demo solution from GitHub and run the two projects in the solution:
Hope that all helps you get a good looking application up and running quickly!
As an end note I must mention this great piece of styling in WinForms, which inspired me to create the Material Design theme for Dragablz in the first place.