zoukankan      html  css  js  c++  java
  • WindowsPhone8.1和Win10常用的API

    1. APP打开后保持屏幕唤醒,不进入休眠

    在OnNavigatedTo中加:

    DisplayRequest displayRequest = new DisplayRequest();
    displayRequest.RequestActive();

    2. App全屏:

    a. 隐藏Status Bar

    await Windows.UI.ViewManagement.StatusBar.GetForCurrentView().HideAsync();

    b. 隐藏下面虚拟导航键

    Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().SuppressSystemOverlays = true;

    3. 处理Windows Phone的Back键消息

    protected override void OnNavigatedTo(NavigationEventArgs e)
    {
        if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            HardwareButtons.BackPressed += HardwareButtons_BackPressed;         
    }
    
    protected override void OnNavigatedFrom(NavigationEventArgs e)
    {
        if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
        base.OnNavigatedFrom(e);
    }
    
    private void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
    {
        e.Handled = true;//按Back无反应
      //Application.Current.Exit(); //退出程序 }
  • 相关阅读:
    node 读取文件
    jQuery全局事件处理函数
    可以发送不同源请求的方式
    ajax 高度封装的函数
    jQuery中AJAX的回调
    jQuery中对AJAX的封装
    ajax 基本的封装
    AJAX 返回数据问题
    ajax 关于响应类型
    动态渲染数据到表格中
  • 原文地址:https://www.cnblogs.com/kunkka/p/4952417.html
Copyright © 2011-2022 走看看