ReSharper C# Live Template for Read-Only Dependency Property and Routed Event Boilerplate

Following on from my previous post, where I shared a Live Template for quickly declaring a normal read-write dependency property and its associated property change event boilerplate, here’s an unsurprisingly similar template for creating a read-only dependency property. 

The only real difference here is the addition of the DependencyPropertyKey, which allows your implementation to set the value of the dependency property without exposing the setter code to consumers of your type.

You’ll probably find that you create read-only dependency properties much less often than read-write properties, but this should still save you some typing when you do need to do so.