Given: Control (x:Name="border1") with a VisualStateManager
. Control's RenderTransform
is set to a TransformGroup
that contains a TranslateTransform
.
In VisualState
"NotShown", TranslateTransform
s Y
property should be animated to a Value
that is (at least) the height of the control being translated (effectively rendering it invisible - ClipToBounds
set true).
This is the code Blend generates:
<VisualState x:Name="NotShown">
<Storyboard>
<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="border1">
<EasingDoubleKeyFrame KeyTime="0" Value="{Binding ActualHeight, ElementName=border1}"/>
</DoubleAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
EDIT (2): {Binding ActualHeight, ElementName=border1}
does not work at all. When run from VS instead of Blend, there is a hint:
Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=ActualHeight; DataItem=null; target element is 'EasingDoubleKeyFrame' (HashCode=57957548); target property is 'Value' (type 'Double')
How do I properly set things up for the purpose of this animation?