Following on from the previous post regarding removing the strings when registering Dependency Properties I wanted to fine tune it so we could remove the need for specifying the type we are defining the dependency properties on.
The way to do this is to cache a static instance of the DependencyPropertyHelper class in our class like so:
private static readonly DependencyPropertyHelper DependencyProperty = new DepenencyPropertyHelper<WorldViewModel>();
Now we can change our dependency property registrations from this:
public static readonly DependencyProperty CameraLookDirectionProperty =
DependencyPropertyHelper<WorldViewModel>.Register(x => x.CameraLookDirection);
To this:
public static readonly DependencyProperty CameraLookDirectionProperty =
DependencyProperty.Register(x => x.CameraLookDirection);