Example #1
0
        internal LayoutSettingViewModel(
            LayoutSettingSync model, GamepadSettingSync gamepadModel, IMessageSender sender, IMessageReceiver receiver
            ) : base(sender)
        {
            _model        = model;
            _gamepadModel = gamepadModel;

            QuickSaveViewPointCommand = new ActionCommand <string>(async s => await _model.QuickSaveViewPoint(s));
            QuickLoadViewPointCommand = new ActionCommand <string>(_model.QuickLoadViewPoint);

            OpenTextureReplaceTipsUrlCommand = new ActionCommand(
                () => UrlNavigate.Open(LocalizedString.GetString("URL_tips_texture_replace"))
                );

            ResetCameraPositionCommand = new ActionCommand(() => SendMessage(MessageFactory.Instance.ResetCameraPosition()));

            ResetCameraSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetCameraSetting)
                );

            ResetDeviceLayoutCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetDeviceLayout)
                );

            ResetHidSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetHidSetting)
                );
            ResetCameraSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetCameraSetting)
                );
            ResetMidiSettingCommand = new ActionCommand(
                () => SettingResetUtils.ResetSingleCategoryAsync(_model.ResetMidiSetting)
                );

            _model.SelectedTypingEffectId.PropertyChanged += (_, __) =>
            {
                TypingEffectItem = TypingEffectSelections
                                   .FirstOrDefault(v => v.Id == _model.SelectedTypingEffectId.Value);
            };

            _typingEffectItem         = TypingEffectSelections[0];
            receiver.ReceivedCommand += OnReceiveCommand;
        }
        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;
 }
 public CameraPositionChecker(IMessageSender sender, LayoutSettingSync layoutSetting)
 {
     _sender        = sender;
     _layoutSetting = layoutSetting;
     _cts           = new CancellationTokenSource();
 }