Using the State Pattern for Adorning in XAML

Here’s a technique I used for adding overlay icons to represent various states of a base view model. Typically, you’ll have a DataTemplate for your primary view model. If the model can be in various states, however, it becomes annoying to manage the data triggers to change the look of the icon, e.g. using adorners.

XAML Template for the WPF DatePicker Control

Here it is in all its glory: the WPF DatePicker control’s XAML template. This was generated using the method found HERE. My mission: to customize it, placing a time picker control below the calendar within the popup. Wish me luck! I’m going down the rabbit hole…