protected override async void PostNavigatedTo(NavigationEventArgs e) { if (SoftAP.SoftAPResult.ParticleDevice != null) { SoftAP.ResetSoftAPResult(); } else if (e.NavigationMode == NavigationMode.Back) { return; } await SetupTinkerAsync(); }
private void LaunchSoftAP() { UI.WindowsRuntimeResourceManager.InjectIntoResxGeneratedApplicationResourcesClass(typeof(Particle.Setup.SetupResources)); SoftAPSettings softAPSettings = new SoftAPSettings(); softAPSettings.AppFrame = Frame; softAPSettings.CompletionPageType = GetType(); softAPSettings.Username = TinkerData.Username; softAPSettings.CurrentDeviceNames = TinkerData.GetDeviceNames(); softAPSettings.OnSoftAPExit += SoftAPSettings_OnSoftAPExit; #if WINDOWS_PHONE_APP hardwareButtonsBackPressed = new EventHandler <Windows.Phone.UI.Input.BackPressedEventArgs>(delegate(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e) { e.Handled = SoftAP.BackButtonPressed(); }); Windows.Phone.UI.Input.HardwareButtons.BackPressed += hardwareButtonsBackPressed; #endif SoftAP.Start(softAPSettings); }
/// <summary> /// 加载事件 /// </summary> protected override void Loaded() { base.Loaded(); try { _ap = new SoftAP(); _timer = new DispatcherTimer(); _timer.Interval = new TimeSpan(0, 0, 4); _timer.Tick += _timer_Tick; _timer.Start(); var result = _ap.getSettings(); Setting.Name = result.SSID; Setting.Password = result.Password.Replace("\0", ""); _hook = new KeyboardHook(); _hook.KeyDownEvent += Hook_KeyDownEvent; _hook.Start(); } catch (Exception ex) { LogHelper.ShowErrorMessage(ex); } }
private void BackButton_Click(object sender, RoutedEventArgs e) { SoftAP.BackButtonPressed(); }