【问题标题】:SL5 - OOB - animating the main windowSL5 - OOB - 主窗口动画
【发布时间】:2013-04-03 23:16:11
【问题描述】:

我需要增大 Application.Current.MainWindow 的大小(当然,在运行 OOB 时)。
有没有办法在情节提要中做到这一点?
我可以以编程方式做到这一点:

private long timerCntr = 0;
    private void OpenBtn_OnClick(object sender, RoutedEventArgs e)
    {
        timerCntr = 0;
        DispatcherTimer t = new DispatcherTimer();
        t.Interval = new TimeSpan(0, 0, 0, 0, 10);
        t.Tick += (o, args) =>
            {
                if (timerCntr < 100)
                {
                    Application.Current.MainWindow.Height += 1;
                    userControl.Height += 1;
                    LayoutRoot.Height += 1;
                    ++timerCntr;
                }
                else
                {
                    t.Stop();
                }
            };
        t.Start();
        OpenStory.Begin();  // Controls opacity of object becoming visible
    }  

感谢您的任何见解...

【问题讨论】:

标签: animation silverlight-5.0 out-of-browser


【解决方案1】:

cmets 中的链接提供了答案。
基本上,添加一个隐藏的滑块控件;在情节提要中更改滑块的值;在滑块的 value_changed 处理程序中更改窗口大小。
效果很好。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-08-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-25
    • 2012-03-05
    • 1970-01-01
    相关资源
    最近更新 更多