Baku.VMagicMirrorConfig.SettingResetUtils.ResetSingleCategoryAsync C# (CSharp) Method

ResetSingleCategoryAsync() public static method

確認ダイアログを出したうえで、個別カテゴリの設定をリセットします。
public static ResetSingleCategoryAsync ( Action resetAction ) : void
resetAction Action
return void
        public static async void ResetSingleCategoryAsync(Action resetAction)
        {
            var indication = MessageIndication.ResetSingleCategoryConfirmation();
            bool res = await MessageBoxWrapper.Instance.ShowAsync(
                indication.Title,
                indication.Content,
                MessageBoxWrapper.MessageBoxStyle.OKCancel
                );

            if (res)
            {
                resetAction();
            }
        }
    }

Usage Example

        internal WindowSettingViewModel(WindowSettingSync model, IMessageSender sender) : base(sender)
        {
            _model = model;

            void UpdatePickerColor() =>
            PickerColor = Color.FromRgb((byte)_model.R.Value, (byte)_model.G.Value, (byte)_model.B.Value);

            _model.R.PropertyChanged += (_, __) => UpdatePickerColor();
            _model.G.PropertyChanged += (_, __) => UpdatePickerColor();
            _model.B.PropertyChanged += (_, __) => UpdatePickerColor();

            BackgroundImageSetCommand   = new ActionCommand(SetBackgroundImage);
            BackgroundImageClearCommand = new ActionCommand(
                () => _model.BackgroundImagePath.Value = ""
                );

            ResetBackgroundColorSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetBackgroundColor)
                );
            ResetWindowPositionCommand = new ActionCommand(_model.ResetWindowPosition);
            ResetOpacitySettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetOpacity)
                );

            //初期値を反映しないと変な事になるので注意
            UpdatePickerColor();
        }
All Usage Examples Of Baku.VMagicMirrorConfig.SettingResetUtils::ResetSingleCategoryAsync
SettingResetUtils