public static NavigateToScreen ( |
||
screenType | ||
return | void |
private async void ConnectToWifi(WiFiAvailableNetwork network, PasswordCredential credential, CoreDispatcher dispatcher) { var didConnect = credential == null? networkPresenter.ConnectToNetwork(network, Automatic) : networkPresenter.ConnectToNetworkWithPassword(network, Automatic, credential); await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { SwitchToItemState(network, WifiConnectingState); }); if (await didConnect) { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { NavigationUtils.NavigateToScreen(typeof(MainPage)); }); } else { await dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var item = SwitchToItemState(network, WifiInitialState); item.IsSelected = false; }); } }
public static void NavigateToNextTutorialFrom(string docName) { var index = Array.FindIndex(Constants.TutorialDocNames, s => s.Equals(docName)); if (index <= -1 || index >= (Constants.TutorialDocNames.Length - 1)) { return; } ++index; var newDocName = Constants.TutorialDocNames[index]; if (newDocName == "HelloBlinky") { #if (!ALWAYS_SHOW_BLINKY) if (DeviceTypeInformation.IsRaspberryPi || DeviceTypeInformation.Type == DeviceTypes.DB410) #endif { NavigationUtils.NavigateToScreen(typeof(TutorialHelloBlinkyPage), newDocName); return; } // Disable unreachable code warning #pragma warning disable 162 newDocName = Constants.TutorialDocNames[++index]; #pragma warning restore 162 } NavigationUtils.NavigateToScreen(typeof(TutorialContentPage), newDocName); }
private void TutorialList_ItemClick(object sender, ItemClickEventArgs e) { var item = e.ClickedItem as FrameworkElement; if (item == null) { return; } switch (item.Name) { case "S1": AppLaunch(new Uri("webonpi1:launch"), new Uri("http://seksenov.github.io/WebHelloBlinky/")); break; case "S2": AppLaunch(new Uri("webonpi2:launch"), new Uri("http://microsoftedge.github.io/JSBrowser/")); break; case "S3": NavigateToSample(new Uri("http://codepen.io/seksenov/pen/obpLmR?editors=1010")); break; case "S4": AppLaunch(new Uri("webonpi4:launch"), new Uri("http://windowstodo.meteor.com/")); break; case "S5": AppLaunch(new Uri("webonpi5:launch"), new Uri("http://aka.ms/meteor-tutorial/")); break; default: NavigationUtils.NavigateToScreen(typeof(TutorialContentPage), item.Name); break; } }
public static void NavigateToNextTutorialFrom(string docName) { var index = Array.FindIndex(Constants.TutorialDocNames, s => s.Equals(docName)); if (index <= -1 || index >= (Constants.TutorialDocNames.Length - 1)) { return; } ++index; var newDocName = Constants.TutorialDocNames[index]; if (newDocName == "HelloBlinky") { #if (!ALWAYS_SHOW_BLINKY) if (DeviceTypeInformation.Type == DeviceTypes.RPI2 || DeviceTypeInformation.Type == DeviceTypes.DB410) #endif { NavigationUtils.NavigateToScreen(typeof(TutorialHelloBlinkyPage), newDocName); return; } newDocName = Constants.TutorialDocNames[++index]; } NavigationUtils.NavigateToScreen(typeof(TutorialContentPage), newDocName); }
public async Task <WiFiConnectionStatus> ConnectToNetwork(WifiListViewItemPresenter network, bool autoConnect) { Log.Enter(); await AvailableNetworksLock.WaitAsync(); if (network == null) { return(WiFiConnectionStatus.UnspecifiedFailure); } try { var result = await network.Adapter.ConnectAsync(network.AvailableNetwork, autoConnect?WiFiReconnectionKind.Automatic : WiFiReconnectionKind.Manual); //Call redirect only for Open Wifi if (IsNetworkOpen(network)) { //Navigate to http://www.msftconnecttest.com/redirect NavigationUtils.NavigateToScreen(typeof(WebBrowserPage), Common.GetResourceText("MicrosoftWifiConnect")); } Log.Leave($"LEAVE {result.ConnectionStatus}"); return(result.ConnectionStatus); } catch (Exception) { return(WiFiConnectionStatus.UnspecifiedFailure); } }
private async void NextButton_Clicked(object sender, RoutedEventArgs e) { var wifiAvailable = networkPresenter.WifiIsAvailable(); SetPreferences(); Type nextScreen; try { nextScreen = (await wifiAvailable) ? typeof(OOBENetwork) : typeof(MainPage); } catch (Exception) { nextScreen = typeof(MainPage); } await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { // If the next screen is the main-page, navigate there, but also launch Cortana to its Consent Page independently if (nextScreen == typeof(MainPage)) { await CortanaHelper.LaunchCortanaToConsentPageAsyncIfNeeded(); } NavigationUtils.NavigateToScreen(nextScreen); }); }
protected override void OnActivated(IActivatedEventArgs args) { // Spot if we are being activated due to inbound pairing request if (null != args && args.Kind == ActivationKind.DevicePairing) { // Ensure the main app loads first OnLaunched(null); // Get the arguments, which give information about the device which wants to pair with this app var devicePairingArgs = (DevicePairingActivatedEventArgs)args; var di = devicePairingArgs.DeviceInformation; // Automatically switch to Bluetooth Settings page NavigationUtils.NavigateToScreen(typeof(Settings), "BluetoothListViewItem"); int bluetoothSettingsIndex = 2; Frame rootFrame = Window.Current.Content as Frame; ListView settingsListView = null; settingsListView = (rootFrame.Content as FrameworkElement).FindName("SettingsChoice") as ListView; settingsListView.Focus(FocusState.Programmatic); bluetoothSettingsIndex = Math.Min(bluetoothSettingsIndex, settingsListView.Items.Count - 1); settingsListView.SelectedIndex = bluetoothSettingsIndex; // Appropriate Bluetooth Listview grid content is forced by App_InboundPairingRequested call to SwitchToSelectedSettings // Fire the event letting subscribers know there's a new inbound request. // In this case Scenario should be subscribed. if (InboundPairingRequested != null) { InboundPairingEventArgs inboundEventArgs = new InboundPairingEventArgs(di); InboundPairingRequested(this, inboundEventArgs); } } }
private async void NetworkGrid_NetworkConnected(object sender, EventArgs e) { await OOBENetworkPageDispatcher.RunAsync(CoreDispatcherPriority.Normal, async() => { await CortanaHelper.LaunchCortanaToConsentPageAsyncIfNeeded(); NavigationUtils.NavigateToScreen(typeof(MainPage)); }); }
private async void countdown_Tick(object sender, object e) { var value = DefaultLanguageProgress.Value + DefaultLanguageProgress.SmallChange * 5; DefaultLanguageProgress.Value = value; if (value >= DefaultLanguageProgress.Maximum) { countdown.Stop(); await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { NavigationUtils.NavigateToScreen(typeof(MainPage)); }); } }
private void TutorialList_ItemClick(object sender, ItemClickEventArgs e) { var item = e.ClickedItem as FrameworkElement; if (item == null) { return; } switch (item.Name) { case "HelloBlinky": NavigationUtils.NavigateToScreen(typeof(TutorialHelloBlinkyPage), item.Name); break; default: NavigationUtils.NavigateToScreen(typeof(TutorialContentPage), item.Name); break; } }
public async Task <bool> ConnectToNetwork(WiFiAvailableNetwork network, bool autoConnect) { try { await NetworkNameToInfoLock.WaitAsync(); if (network == null) { return(false); } // We need to use TryGetValue here. If we are rescanning for Wifi networks // (ie. 'await'ing on ScanAsync() in UpdateInfo(), 'NetworkNameToInfo' may not // have an entry described by the key'network'. WiFiAdapter wifiAdapter; if (!NetworkNameToInfo.TryGetValue(network, out wifiAdapter)) { return(false); } try { var result = await wifiAdapter.ConnectAsync(network, autoConnect?WiFiReconnectionKind.Automatic : WiFiReconnectionKind.Manual); //Call redirect only for Open Wifi if (IsNetworkOpen(network)) { //Navigate to http://www.msftconnecttest.com/redirect NavigationUtils.NavigateToScreen(typeof(WebBrowserPage), Common.GetLocalizedText("MicrosoftWifiConnect")); } return(result.ConnectionStatus == WiFiConnectionStatus.Success); } catch (Exception) { return(false); } } finally { NetworkNameToInfoLock.Release(); } }
public static void NavigateToNextTutorialFrom(string docName) { var index = Array.FindIndex(Constants.TutorialDocNames, s => s.Equals(docName)); if (index <= -1 || index >= (Constants.TutorialDocNames.Length - 1)) { return; } ++index; var newDocName = Constants.TutorialDocNames[index]; if (newDocName == "HelloBlinky") { NavigationUtils.NavigateToScreen(typeof(TutorialHelloBlinkyPage), newDocName); } else { NavigationUtils.NavigateToScreen(typeof(TutorialContentPage), newDocName); } }
private async void NextButton_Tapped(object sender, TappedRoutedEventArgs e) { var wifiAvailable = NetworkPresenter.WifiIsAvailable(); SetPreferences(); Type nextScreen; try { nextScreen = (await wifiAvailable) ? typeof(OOBENetwork) : typeof(MainPage); } catch (Exception) { nextScreen = typeof(MainPage); } await Window.Current.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { NavigationUtils.NavigateToScreen(nextScreen); }); }
private void SettingsButton_Clicked(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(Settings)); }
private void LegoProject_Click(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(LegoProjectPage)); }
private void AboutButton_Click(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(AboutPage)); }
private void Tutorials_Clicked(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(TutorialMainPage)); }
private void CommandLineButton_Clicked(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(CommandLinePage)); }
private void WebBrowserButton_Clicked(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(WebBrowserPage)); }
private void SkipButton_Clicked(object sender, RoutedEventArgs e) { CortanaHelper.LaunchCortanaToConsentPageAsyncIfNeeded(); NavigationUtils.NavigateToScreen(typeof(MainPage)); }
private void SetPreferences() { if (null == LanguagesListView.SelectedItem) { NavigationUtils.NavigateToScreen(typeof(MainPage)); } else { LangApplyStack.Visibility = Visibility.Collapsed; string selectedLanguage = LanguagesListView.SelectedItem as string; //Check existing lang Tuple var currentLangTuple = languageManager.GetLanguageTuple(languageManager.GetLanguageTagFromDisplayName(selectedLanguage)); SpeechSupport.Text = currentLangTuple.Item2 ? languageManager["SpeechSupportText"] : languageManager["SpeechNotSupportText"]; if (LanguageManager.GetCurrentLanguageDisplayName().Equals(selectedLanguage)) { //Do Nothing return; } //Check if selected language is part of ffu var newLang = languageManager.CheckUpdateLanguage(selectedLanguage); if (LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4).Equals(selectedLanguage)) { //Update var langReturned = languageManager.UpdateLanguage(selectedLanguage); //ffu list, Show user to restart to use the System Languages if (newLang.Item1) { Common.LangApplyRebootRequired = true; LangApplyStack.Visibility = Visibility.Visible; } //else //skip providing option to restart app } else { if (newLang.Item2) { //Stop Automatic counter to switch to next screen timer.Stop(); countdown.Stop(); ChooseDefaultLanguage.Visibility = Visibility.Collapsed; CancelButton.Visibility = Visibility.Collapsed; //If different, show the popup for confirmation PopupText2.Text = LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4); PopupYes.Content = LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4); PopupText1.Text = languageManager["LanguagePopupText1"]; PopupText3.Text = languageManager["LanguagePopupText3"]; PopupNo.Content = LanguagesListView.SelectedItem as string; double hOffset = (Window.Current.Bounds.Width) / 4; double vOffset = (Window.Current.Bounds.Height) / 2; StandardPopup.VerticalOffset = vOffset; StandardPopup.HorizontalOffset = hOffset; if (!StandardPopup.IsOpen) { StandardPopup.IsOpen = true; } } else { //Just update silently in the background and dont ask for restart app var langReturned = languageManager.UpdateLanguage(selectedLanguage); } } } }
private void Samples_Clicked(object sender, RoutedEventArgs e) { showAllSamples(); NavigationUtils.NavigateToScreen(typeof(TutorialMainPage)); }
private void WindowsOnDevices_Click(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(WebBrowserPage), Constants.WODUrl); }
private void DeviceInfo_Clicked(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(MainPage)); }
private void SecurityNoticeLearnMoreButton_Click(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(WebBrowserPage), Constants.IoTCoreManufacturingGuideUrl); }
/// <summary> /// Invokes Settings->Network ListView Item /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void OnSettings_Click(object sender, RoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(Settings), "NetworkListViewItem"); }
private void SkipButton_Tapped(object sender, TappedRoutedEventArgs e) { NavigationUtils.NavigateToScreen(typeof(MainPage)); }