Вопрос

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