本文介绍了Flyout堆栈面板在silverlight 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述






你好我是银光的新手......现在我试图在这个。我的要求是我的堆栈面板不应该是可见的,当我的鼠标进入按钮时,堆栈面板应该是可见的,它应该飞出来,它完美地工作。当它收缩它时面临的问题应该缩小并且应该是隐形的,我的代码收缩效果看不清楚。我们可以暂停几秒钟的可见性???我包括代码...任何帮助将不胜感激..



Hi I'm a newbie in silverlight...Now im trying to implement a flyout stack panel with help from this Link.My requirement is that intially my stack panel should not be visible and when my mouse enter the button the stack panel should be visible and it should fly out which works perfectly.The issue im facing when it shrink it should shrink and should be invisible,with my code the shrink effect is not seen properly.Can we like halt the visibility for few seconds???I'm including the code...Any help will be greatly appreciated..

<Grid x:Name="LayoutRoot">
       <StackPanel x:Name="spButtons" Orientation="Vertical" Visibility="Collapsed"
   removed="Black" Height="14" Width="500" RenderTransformOrigin="0.502,-0.263" Margin="-157.428,184.483,297.427,281.517" UseLayoutRounding="False" d:LayoutRounding="Auto">
           <StackPanel.RenderTransform>
               <CompositeTransform Rotation="-89.14" TranslateX="-31.313" TranslateY="29.255"/>
           </StackPanel.RenderTransform>
       </StackPanel>
       <Button Margin="436,109,101,333" x:Name="btTest" Height="40" Width="50" MouseEnter="btTest_MouseEnter" MouseLeave="btTest_MouseLeave" />
       <Grid.Resources>
           <Storyboard x:Name="Shrink">
               <DoubleAnimation Storyboard.TargetName="spButtons"
    Storyboard.TargetProperty="Height"
    From="40" To="14" Duration="00:00:20.0" />
           </Storyboard>
           <Storyboard x:Name="Grow">
               <DoubleAnimation Storyboard.TargetName="spButtons"
    Storyboard.TargetProperty="Height"
    From="14" To="40" Duration="00:00:00.5" />
           </Storyboard>
       </Grid.Resources>
   </Grid>




private void btTest_MouseEnter(object sender, MouseEventArgs e)
        {
            spButtons.Visibility = Visibility.Visible;
            Grow.Begin();
        }

        private void btTest_MouseLeave(object sender, MouseEventArgs e)
        {
            Shrink.Begin();
            spButtons.Visibility = Visibility.Collapsed;
        }

推荐答案

这篇关于Flyout堆栈面板在silverlight 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 13:32