Frage

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?

War es hilfreich?

Lösung

I used proxy binding as this post:

How to bind to data when the DataContext is not inherited

And it worked.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top