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();
        }
        public RootSettingSync(IMessageSender sender, IMessageReceiver receiver)
        {
            AvailableLanguageNames = new ReadOnlyObservableCollection <string>(_availableLanguageNames);

            _sender = sender;

            Window          = new WindowSettingSync(sender);
            Motion          = new MotionSettingSync(sender);
            Layout          = new LayoutSettingSync(sender);
            Gamepad         = new GamepadSettingSync(sender);
            Light           = new LightSettingSync(sender);
            WordToMotion    = new WordToMotionSettingSync(sender, receiver);
            ExternalTracker = new ExternalTrackerSettingSync(sender);
            Automation      = new AutomationSettingSync(sender);

            //NOTE; LanguageSelectorとの二重管理っぽくて若干アレだがこのままで行く
            //初期値Defaultを入れることで、起動直後にPCのカルチャベースで言語を指定しなきゃダメかどうか判別する
            LanguageName = new RProperty <string>("Default", s =>
            {
                LanguageSelector.Instance.LanguageName = s;
            });
        }
 public DeviceFreeLayoutHelper(LayoutSettingSync layout, WindowSettingSync window)
 {
     _layout = layout;
     _window = window;
 }