zoukankan      html  css  js  c++  java
  • wp 实现N秒无操作后自动隐藏控件

    public partial class a: PhoneApplicationPage
        {
            DispatcherTimer timer = new DispatcherTimer();
            public a()
            {
                timer = new DispatcherTimer();
                timer.Interval = TimeSpan.FromSeconds(10);
                timer.Tick += new EventHandler(timer_Tick);

                timer.Start();
            }

            protected override void OnManipulationStarted(ManipulationStartedEventArgs e)
            {
                base.OnManipulationStarted(e);
                timer.Stop();
                this.Search.Visibility = Visibility.Visible;
                SystemTray.IsVisible = true;
                this.ApplicationBar.IsVisible = true;

            }

            protected override void OnMouseLeave(MouseEventArgs e)
            {
                base.OnMouseLeave(e);
                timer.Interval = TimeSpan.FromSeconds(10);
                timer.Tick += new EventHandler(timer_Tick);

                timer.Start();
            }

            void timer_Tick(object sender, EventArgs e)
            {
                timer.Stop();
                this.Search.Visibility = Visibility.Collapsed;
                SystemTray.IsVisible = false;
                this.ApplicationBar.IsVisible = false;
            }
        }

  • 相关阅读:
    存储器类型区分
    语言基础(25):容器与算法
    X11-forwarding
    语言基础(24):句柄类
    Markdown(2):流程图
    剑指offer-树的子结构
    剑指offer-判断链表是否有环
    剑指offer-求链表的中间结点
    剑指offer-合并两个排序的链表
    剑指offer-反转链表
  • 原文地址:https://www.cnblogs.com/lutter/p/2763089.html
Copyright © 2011-2022 走看看