zoukankan      html  css  js  c++  java
  • windows8 后台传递下载

    后台传递下载示例
    这个示例演示了power-friendly,cost-aware和灵活的行为背景的传输API为Windows运行时应用程序
    void MainPage_Loaded(object sender, RoutedEventArgs e)
            {
                // Figure out what resolution and orientation we are in and respond appropriately
                CheckResolutionAndViewState();

                // Load the ScenarioList page into the proper frame
                ScenarioList.Navigate(Type.GetType(_rootNamespace + ".ScenarioList"), this);
            }

            #region Resolution and orientation code

            void DisplayProperties_LogicalDpiChanged(object sender)
            {
                CheckResolutionAndViewState();
            }

            void CheckResolutionAndViewState()
            {
                VisualStateManager.GoToState(this, ApplicationView.Value.ToString() + DisplayProperties.ResolutionScale.ToString(), false);
            }

            void MainPage_ViewStateChanged(ApplicationView sender, ApplicationViewStateChangedEventArgs args)
            {
                CheckResolutionAndViewState();
            }

            #endregion

            private void SetFeatureName(string str)
            {
                FeatureName.Text = str;
            }

            async void Footer_Click(object sender, RoutedEventArgs e)
            {
                await Windows.System.Launcher.LaunchUriAsync(new Uri(((HyperlinkButton)sender).Tag.ToString()));
            }

            public void NotifyUser(string strMessage, NotifyType type)
            {
                switch (type)
                {
                    case NotifyType.StatusMessage:
                        StatusBlock.Style = Resources["StatusStyle"as Style;
                        break;
                    case NotifyType.ErrorMessage:
                        StatusBlock.Style = Resources["ErrorStyle"as Style;
                        break;
                }
                StatusBlock.Text = strMessage;
            }

            public void DoNavigation(Type pageType, Frame frame)
            {
                frame.Navigate(pageType, this);
                if (pageType.Name.Contains("Input"))
                {
                    // Raise InputFrameLoaded so downstream pages know that the input frame content has been loaded.
                    if (InputFrameLoaded != null)
                    {
                        InputFrameLoaded(thisnew EventArgs());
                    }
                }
                else
                {
                    // Raise OutputFrameLoaded so downstream pages know that the output frame content has been loaded.
                    if (OutputFrameLoaded != null)
                    {
                        OutputFrameLoaded(thisnew EventArgs());
                    }
                }

            } 

     完整示例 /Files/risk/windows8/后台传递下载sample.rar

  • 相关阅读:
    PAT A1094 The Largest Generation (25 分)——树的bfs遍历
    PAT A1055 The World's Richest (25 分)——排序
    PAT A1052 Linked List Sorting (25 分)——链表,排序
    PAT A1076 Forwards on Weibo (30 分)——图的bfs
    辅导员
    辅导员面试
    C程序设计
    Excel VBA 基本概念
    Excel函数
    导入excel表的数据到数据库ssh
  • 原文地址:https://www.cnblogs.com/risk/p/2495479.html
Copyright © 2011-2022 走看看