I have a Storyboard with StringAnimationUsingKeyFrames:

<Storyboard> 
    <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(Button.ToolTip)" Storyboard.TargetName="xButton">
        <DiscreteStringKeyFrame KeyTime="0" Value="{Binding State,Converter={StaticResource StateToStringConverter},StringFormat={x:Static props:Resources.xToolTipText}}"/>
    </StringAnimationUsingKeyFrames>
    ....
<Storyboard> 

xToolTipText comes from Resources:

Press ({0} State)

The value received for resources is variable State (int) from Model.

The whole thing can not work because binding of DiscreteStringKeyFrame does not work (I think the reason is that he does not belong to the visual tree).

Which is another way I can do this?

有帮助吗?

解决方案

I used proxy binding as this post:

How to bind to data when the DataContext is not inherited

And it worked.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top