コード例 #1
0
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar"))
     {   //透明化手机状态栏
         var statusBar = StatusBar.GetForCurrentView();
         statusBar.BackgroundOpacity = 0;
         statusBar.ForegroundColor   = Colors.Black;
         this.Frame.Margin           = new Thickness(0, -1, 0, 0);
         Constants.IsMobile          = true;
         TXTBLKtitle.Visibility      = Visibility.Collapsed;
         GRIDtitle.Height            = Constants.ContentMargin;
     }
     else
     {   //透明化电脑端标题栏
         var coreTitleBar = Windows.ApplicationModel.Core.CoreApplication.GetCurrentView().TitleBar;
         var appTitleBar  = Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().TitleBar;
         coreTitleBar.ExtendViewIntoTitleBar = true;
         appTitleBar.ButtonBackgroundColor   = Colors.Transparent;
         Constants.IsMobile = false;
         Window.Current.SetTitleBar(GRIDtitle);
         Constants.ContentMargin = GRIDtitle.Height;
     }
     HEIGHTtitle.Height    = new GridLength(Constants.ContentMargin);
     FRAMEcontent.Margin   = new Thickness(0, Constants.ContentMargin, 0, 0);
     CHKBXhamburger.Margin = new Thickness(0, Constants.ContentMargin, 0, 0);
     //GRIDblur.Opacity = 0;
     FRAMEcontent.Navigate(typeof(IPGW2Page));
     //STRBDbgChangeBack.Begin();
     GetWeekInfo();
 }
コード例 #2
0
        /*private async void LoadBg()
         * {
         *  try
         *  {
         *      StorageFile tempFile = await Cache.getCacheFile("CachedBg.png");
         *      if (tempFile != null)
         *      {
         *          using(IRandomAccessStream streamIn=await tempFile.OpenAsync(FileAccessMode.Read))
         *          {
         *              Bg = new WriteableBitmap(1920, 1080);
         *              Bg.SetSource(streamIn);
         *          }
         *
         *      }
         *      else
         *      {
         *          Bg = new WriteableBitmap(1920, 1080);
         *          var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/DefaultBg.png"));
         *          Bg.SetSource(await file.OpenAsync(FileAccessMode.Read));
         *      }
         *  }
         *  catch(Exception e)
         *  {
         *      Bg = new WriteableBitmap(1920, 1080);
         *      var file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///Assets/DefaultBg.png"));
         *      Bg.SetSource(await file.OpenAsync(FileAccessMode.Read));
         *      Debug.WriteLine(e.StackTrace + "\r\n");
         *  }
         *  finally
         *  {
         *      BRSHbg.ImageSource = Bg;
         *      GRIDroot.Background = BRSHbg;
         *  }
         *  try
         *  {
         *      StorageFile tempFile = await Cache.getCacheFile("CachedBluredBg.png");
         *      using (IRandomAccessStream streamIn2 = await tempFile.OpenAsync(FileAccessMode.Read))
         *      {
         *          BluredBg = new WriteableBitmap(1920, 1080);
         *          BluredBg.SetSource(streamIn2);
         *      }
         *  }
         *  catch(Exception e)
         *  {
         *      try
         *      {
         *          BluredBg = await Util.Blur(Bg,Constants.BgBluredLevel);
         *          await Cache.savePngFile(BluredBg, "CachedBluredBg.png");
         *      }
         *      catch
         *      {
         *          BluredBg = new WriteableBitmap(1920, 1080);
         *          Debug.WriteLine(e.StackTrace + "\r\n");
         *      }
         *  }
         *  finally
         *  {
         *      BRSHbluredBg.ImageSource = BluredBg;
         *  }
         * }*/

        private void LSTBXmenu_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            switch (LSTBXmenu.SelectedIndex)
            {
            case 0:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(UserInfoPage));
            }
            break;

            case 1:
            {
                //STRBDbgChangeBack.Begin();
                FRAMEcontent.Navigate(typeof(IPGW2Page));
            } break;

            case 2:
            {
                //if(FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(CoursePage));
            } break;

            case 3:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(InfoPage));
            }
            break;

            case 4:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(NCPage));
            }
            break;

            case 5:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(MailPage));
            }
            break;

            case 6:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(ChatPage));
            }
            break;

            case 7:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(PkuHolePage));
            } break;

            case 8:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(LFmasterPage));
            } break;

            case 9:
            {
                //if (FRAMEcontent.Content is IPGW2Page) STRBDbgChange.Begin();
                FRAMEcontent.Navigate(typeof(SettingPage));
            }
            break;

            default: break;
            }
        }