public static async Task Show(ControllerSettingsViewModel viewmodel) { MotionSettingsWindow content = new MotionSettingsWindow(viewmodel); ContentDialog contentDialog = new ContentDialog { Title = LocaleManager.Instance["ControllerMotionTitle"], PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"], SecondaryButtonText = "", CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"], Content = content }; contentDialog.PrimaryButtonClick += (sender, args) => { var config = viewmodel.Configuration as InputConfiguration <GamepadInputId, StickInputId>; config.Slot = content._viewmodel.Slot; config.EnableMotion = content._viewmodel.EnableMotion; config.Sensitivity = content._viewmodel.Sensitivity; config.GyroDeadzone = content._viewmodel.GyroDeadzone; config.AltSlot = content._viewmodel.AltSlot; config.DsuServerHost = content._viewmodel.DsuServerHost; config.DsuServerPort = content._viewmodel.DsuServerPort; config.EnableCemuHookMotion = content._viewmodel.EnableCemuHookMotion; config.MirrorInput = content._viewmodel.MirrorInput; }; await contentDialog.ShowAsync(); }
public static async Task Show(ControllerSettingsViewModel viewmodel, StyleableWindow window) { ContentDialog contentDialog = window.ContentDialog; string name = string.Empty; RumbleSettingsWindow content = new RumbleSettingsWindow(viewmodel); if (contentDialog != null) { contentDialog.Title = LocaleManager.Instance["ControllerRumbleTitle"]; contentDialog.PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"]; contentDialog.SecondaryButtonText = ""; contentDialog.CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"]; contentDialog.Content = content; contentDialog.PrimaryButtonClick += (sender, args) => { var config = viewmodel.Configuration as InputConfiguration <GamepadInputId, StickInputId>; config.StrongRumble = content._viewmodel.StrongRumble; config.WeakRumble = content._viewmodel.WeakRumble; }; await contentDialog.ShowAsync(); } }
public RumbleSettingsWindow(ControllerSettingsViewModel viewmodel) { var config = viewmodel.Configuration as InputConfiguration <GamepadInputId, StickInputId>; _viewmodel = new InputConfiguration <GamepadInputId, StickInputId>() { StrongRumble = config.StrongRumble, WeakRumble = config.WeakRumble }; InitializeComponent(); DataContext = _viewmodel; }
public ControllerSettingsWindow() { DataContext = ViewModel = new ControllerSettingsViewModel(this); InitializeComponent(); foreach (ILogical visual in SettingButtons.GetLogicalDescendants()) { if (visual is ToggleButton button && !(visual is CheckBox)) { button.Checked += Button_Checked; button.Unchecked += Button_Unchecked; } } }
public MotionSettingsWindow(ControllerSettingsViewModel viewmodel) { var config = viewmodel.Configuration as InputConfiguration <GamepadInputId, StickInputId>; _viewmodel = new InputConfiguration <GamepadInputId, StickInputId>() { Slot = config.Slot, AltSlot = config.AltSlot, DsuServerHost = config.DsuServerHost, DsuServerPort = config.DsuServerPort, MirrorInput = config.MirrorInput, EnableMotion = config.EnableMotion, Sensitivity = config.Sensitivity, GyroDeadzone = config.GyroDeadzone, EnableCemuHookMotion = config.EnableCemuHookMotion }; InitializeComponent(); }
public static async Task Show(ControllerSettingsViewModel viewmodel) { RumbleSettingsWindow content = new RumbleSettingsWindow(viewmodel); ContentDialog contentDialog = new ContentDialog { Title = LocaleManager.Instance["ControllerRumbleTitle"], PrimaryButtonText = LocaleManager.Instance["ControllerSettingsSave"], SecondaryButtonText = "", CloseButtonText = LocaleManager.Instance["ControllerSettingsClose"], Content = content, }; contentDialog.PrimaryButtonClick += (sender, args) => { var config = viewmodel.Configuration as InputConfiguration <GamepadInputId, StickInputId>; config.StrongRumble = content._viewmodel.StrongRumble; config.WeakRumble = content._viewmodel.WeakRumble; }; await contentDialog.ShowAsync(); }