private void btnLogin_Tapped(object sender, TappedRoutedEventArgs e) { tbIP.IsEnabled = false; tbPort.IsEnabled = false; tbPassword.IsEnabled = false; btnLogin.IsEnabled = false; AuthClass _auth = new AuthClass(tbIP.Text, tbPort.Text, tbPassword.Text); Frame.Navigate(typeof(MixerPage), _auth); }
protected override void OnNavigatedTo(NavigationEventArgs e) { base.OnNavigatedTo(e); OBSWebsocket _obs = new OBSWebsocket(); Dictionary <string, SourceClass> currentSources = new Dictionary <string, SourceClass>(); this._obs = _obs; this.currentSources = currentSources; _obs.Disconnected += _obs_Disconnected; _obs.SourceVolumeChanged += _obs_SourceVolumeChanged; _obs.SourceCreated += _obs_SourceCreated; _obs.SourceDestroyed += _obs_SourceDestroyed; AuthClass _auth = (AuthClass)e.Parameter; if (!_obs.IsConnected) { try { _obs.Connect($"ws://{_auth.IP}:{_auth.Port}", _auth.Password); } catch (Exception ex) { Frame.Navigate(typeof(MainPage), ex); return; } } else { Frame.Navigate(typeof(MainPage), null); return; } SliderInit(); MixerInit(); }