This is my Dependency property:
public static readonly DependencyProperty ButtonTapSoundProperty = DependencyProperty.RegisterAttached("ButtonTapSound", typeof (Uri), typeof (ButtonDependencyObject), new PropertyMetadata(default(Uri), UriChanged));
I then use it like this:
<Button buttonDependencyObject:ButtonDependencyObject.ButtonTapSound="{Binding ElementName=TapSound}" ... />
This works perfectly at design time and run time.
However if I define it inside a control template like this:
<ControlTemplate x:Name="TapSound" TargetType="Button">
<Button buttonDependencyObject:ButtonDependencyObject.ButtonTapSound="{Binding ElementName=TapSound}" ... />
</ControlTemplate>
It works at runtime but not in the Visual Studio designer
ButtonTapSoundProperty
-Class, so we can try to reproduce it. Everything else may lead to various or no results – Communicable