Establecer propiedad adjunta personalizada en StoryBoard
Tengo un guión gráfico y me gustaría establecer la propiedad adjunta VisualStateUtility.InitialState. He intentado varias combinaciones, pero la propiedad nunca se resuelve.
Obtuve el siguiente error: No se puede resolver TargetProperty (VisualStateUtility.InitialState)
¿Cómo puedo establecer el valor de mi propiedad adjunta personalizada en el Storyboard?
<ObjectAnimationUsingKeyFrames Duration="0" Storyboard.TargetProperty="(Fully.Qualified.Namespace.VisualStateUtility.InitialState)" Storyboard.TargetName="ExpanderButton">
public static string GetInitialState(DependencyObject obj)
{
return (string)obj.GetValue(InitialStateProperty);
}
public static void SetInitialState(DependencyObject obj, string value)
{
obj.SetValue(InitialStateProperty, value);
}
// Using a DependencyProperty as the backing store for InitialState. This enables animation, styling, binding, etc...
public static readonly DependencyProperty InitialStateProperty =
DependencyProperty.RegisterAttached("InitialState", typeof(string), typeof(VisualStateUtility), new PropertyMetadata(null,OnInitialStatePropertyChanged));