private async void RootPage_Loaded(object sender, RoutedEventArgs e) { ShowLoading("authenticating"); if (App.Me == null) { try { var success = await Authenticate(); } catch { } } if (App.IsXbox()) { this.Frame.Navigate(typeof(MainPage)); } HideLoading(); var optionCenterY = (float)optionsView.DesiredSize.Height / 2; var optionCenterX = (float)optionsView.DesiredSize.Width / 2; optionsView.Scale(0.8f, 0.8f, optionCenterX, optionCenterY, duration: 0) .Then().Scale(1, 1, optionCenterX, optionCenterY).Fade(1).Start(); }
private void MainPage_Loaded(object sender, RoutedEventArgs e) { DataService.Instance.Dispatcher = new DispatcherWrapper(Dispatcher); BackgroundContainer.Blur(20, 0).Start(); if (_isHost) { if (App.IsXbox()) { PlayPause.Focus(FocusState.Keyboard); } this.PointerMoved += MainPage_PointerMoved; this.KeyDown += MainPage_KeyDown; _playerService.PropertyChanged += _dataService_PropertyChanged; _timer = new DispatcherTimer(); _timer.Interval = TimeSpan.FromSeconds(10); _timer.Tick += _timer_Tick; _timer.Start(); } else { AddButton.Focus(FocusState.Pointer); UserSongCollection.ItemsSource = (_viewModel as ClientViewModel).UserSongs; var t = (_viewModel as ClientViewModel).LoadUserSongs(); this.SizeChanged += MainPage_SizeChanged; } }
/// <summary> /// Invoked when the application is launched normally by the end user. Other entry points /// will be used such as when the application is launched to open a specific file. /// </summary> /// <param name="e">Details about the launch request and process.</param> protected override void OnLaunched(LaunchActivatedEventArgs e) { if (App.IsXbox()) { ApplicationView.GetForCurrentView().SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); } if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.ApplicationView")) { CoreApplication.GetCurrentView().TitleBar.ExtendViewIntoTitleBar = true; var titleBar = ApplicationView.GetForCurrentView().TitleBar; if (titleBar != null) { titleBar.ButtonForegroundColor = Colors.White; titleBar.ButtonBackgroundColor = Colors.Transparent; titleBar.BackgroundColor = Color.FromArgb(255, 13, 15, 30); } } CreateRootFrame(e.PreviousExecutionState, e.Arguments, e.PrelaunchActivated); }