/// <summary> /// This button opens the controller settings option /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnControllerSettings(object sender, RoutedEventArgs e) { if (gameList.Items.Count == 0) { return; } _listIndex = gameList.SelectedIndex; Joystick.Listen(); Application.Current.Windows.OfType <MainWindow>().Single().contentControl.Content = Joystick; }
private void FlyoutSettings_OnIsOpenChanged(object sender, RoutedEventArgs e) { if (FlyoutSettings.IsOpen) { JoystickControl.Listen(); } else { JoystickControl.StopListening(); } }
/// <summary> /// This button opens the controller settings option /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void BtnControllerSettings(object sender, RoutedEventArgs e) { if (gameList.Items.Count == 0) { return; } Joystick = new JoystickControl(_contentControl, this); Joystick.LoadNewSettings(_gameNames[gameList.SelectedIndex], (ListBoxItem)gameList.SelectedItem); Joystick.Listen(); Application.Current.Windows.OfType <MainWindow>().Single().contentControl.Content = Joystick; }
/// <summary> /// This button opens the controller settings option /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void Button_Click_1(object sender, RoutedEventArgs e) { Joystick.Listen(); Application.Current.Windows.OfType <MainWindow>().Single().contentControl.Content = Joystick; }