Domanda

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?

È stato utile?

Soluzione

I used proxy binding as this post:

How to bind to data when the DataContext is not inherited

And it worked.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top