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();
            }
        }
예제 #2
0
        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();
        }