/// <summary> /// モデルおよび設定を用いてインスタンスを初期化します。 /// </summary> /// <param name="model">必要な描画物を実際に用意するモデル</param> /// <param name="mainWindow">位置決めに使うための親ウィンドウ</param> /// <param name="shownCharacterNameSetting">表示名の設定</param> /// <param name="textSetting">テキストのフォント設定</param> /// <param name="colorSetting">色の設定</param> /// <param name="layoutSetting">配置の設定</param> public ChatWindowViewModel( IChatWindowModel model, IMainWindow mainWindow, IShownCharacterNameSetting shownCharacterNameSetting, IChatWindowTextSetting textSetting, IChatWindowColorSetting colorSetting ) { Position = new ChatWindowPositionViewModel(model.Position); CharacterName = new ShownCharacterNameViewModel(shownCharacterNameSetting); TextFont = new ChatWindowTextViewModel(textSetting); Color = new ChatWindowColorViewModel(colorSetting); Appearance = new ChatWindowAppearanceViewModel(this); AssignToModel(model); SyncTopmostToMainWindow(mainWindow); }
/// <summary>モデルの設定一覧から設定画面のビューモデルを初期化します。</summary> /// <param name="modelSetting">モデル側の設定</param> public SettingWindowViewModel(CharacterSetting setting) { Voice = new VoiceViewModel(setting.Voice); ChatWindowText = new ChatWindowTextViewModel(setting.ChatWindowText); ChatWindowColor = new ChatWindowColorViewModel(setting.ChatWindowColor); ChatWindowLayout = new ChatWindowLayoutViewModel(setting.ChatWindowLayout); ShownCharacterName = new ShownCharacterNameViewModel(setting.ShownCharacterName); CharacterAppearance = new CharacterAppearanceViewModel(setting.CharacterAppearance); ScriptApi = new ScriptApiSettingViewModel(setting.ScriptApi); ScriptUpdate = new ScriptUpdateSettingViewModel(setting.ScriptUpdate); ScriptRoutine = new ScriptRoutineSettingViewModel(setting.ScriptRoutine); Nadenade = new NadeSettingViewModel(setting.Nadenade); CharacterName = setting.CharacterName; }