문제

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