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;
            }
        }

  • 相关阅读:
    初学网络编程
    Python模块(三)(正则,re,模块与包)
    Python模块(二)(序列化)
    idea2020.2安装与破解
    部署-jenkins发布项目到linux环境
    部署-jenkins发布项目到windows环境
    部署-jenkins与gitlab结合使用
    部署-docker推送镜像到远程仓库
    部署-gitlab克隆地址踩坑
    部署-docker安装jenkins
  • 原文地址:https://www.cnblogs.com/lutter/p/2763089.html
Copyright © 2011-2022 走看看