开发者

Change the source of Image using StoryBoard

开发者 https://www.devze.com 2022-12-24 17:28 出处:网络
I want to change the source of an image using storyboard in silverlight blend on mouse over: <VisualState x:Name=\"MouseOver\">

I want to change the source of an image using storyboard in silverlight blend on mouse over:

   <VisualState x:Name="MouseOver">
<Storyboard>
   ---c开发者_如何学Code here--                                           
</Storyboard>
</VisualState>


Ok finally solved it :

On mouse hover i just turn out the visbility of an image to colapsed and made the visibility of other image to visible. That's it :)

                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="fillColor">
                                            <SplineDoubleKeyFrame KeyTime="0" Value=".35"/>
                                        </DoubleAnimationUsingKeyFrames>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="image">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Collapsed</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>

                                    <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="hoverimage">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                    <DiscreteObjectKeyFrame.Value>
                                    <Visibility>Visible</Visibility>
                                    </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                    </ObjectAnimationUsingKeyFrames>                
                                    </Storyboard>
                                </VisualState> 
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号