zoukankan      html  css  js  c++  java
  • 显示隐藏的动画

    一:xaml版

    <TextBlock Height="23" HorizontalAlignment="Left" Cursor="Hand" Margin="10,10,0,0" Name="tbClick" Text="Click To Show" VerticalAlignment="Top" />
            <ListView Name="lvRoot" Width="200" Height="0">
                <ListView.View>
                    <GridView>
                        <GridViewColumn DisplayMemberBinding="{Binding ShowColor}" Header="Color" Width="200" />
                    </GridView>
                </ListView.View>
            </ListView>

    二:后台绑定

    DoubleAnimation animation = null;
                if (!flag)
                {
                    animation = new DoubleAnimation();
                    animation.From = 0;
                    animation.To = 200;
                    animation.Duration = new Duration(TimeSpan.FromSeconds(1));
                    Storyboard.SetTargetName(animation, lvRoot.Name);
                    Storyboard.SetTargetProperty(animation, new PropertyPath(HeightProperty));
                    flag = true;
                }
                else
                {
                    animation = new DoubleAnimation();
                    animation.From = 200;
                    animation.To = 0;
                    animation.Duration = new Duration(TimeSpan.FromSeconds(1));
                    Storyboard.SetTargetName(animation, lvRoot.Name);
                    Storyboard.SetTargetProperty(animation, new PropertyPath(ListView.HeightProperty));
                    flag = false;
                }
                Storyboard board = new Storyboard();
                board.Children.Add(animation);
                board.Begin(this);
  • 相关阅读:
    java UDP传输
    InetAddress与Socket
    TCP和UDP的联系和用途
    网络通讯要素
    什么是网络编程?
    java 合并流(SequenceInputStream)
    最长上升子序列之基础
    《Linux Device Drivers》第十五章 内存映射和DMA——note
    HDU 5092 DP
    NGUI: UIPanel控件
  • 原文地址:https://www.cnblogs.com/kelei12399/p/2594676.html
Copyright © 2011-2022 走看看