Пример #1
0
        public ChatWindowTextViewModel(IChatWindowTextSetting setting)
        {
            FontSize       = setting.FontSize;
            FontFamilyName = setting.FontFamilyName;
            IsFontBold     = setting.IsFontBold;
            IsFontItalic   = setting.IsFontItalic;

            AssignToSetting(setting);
        }
Пример #2
0
        public ChatWindowTextViewModel(IChatWindowTextSetting setting)
        {
            FontSize = setting.FontSize;
            FontFamilyName = setting.FontFamilyName;
            IsFontBold = setting.IsFontBold;
            IsFontItalic = setting.IsFontItalic;

            AssignToSetting(setting);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
        /// <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);
        }
Пример #5
0
        private void AssignToSetting(IChatWindowTextSetting setting)
        {
            PropertyChanged += (_, e) =>
            {
                if (e.PropertyName == nameof(FontSize))
                {
                    setting.FontSize = FontSize;
                }
                else if (e.PropertyName == nameof(FontFamilyName))
                {
                    setting.FontFamilyName = FontFamilyName;
                }
                else if (e.PropertyName == nameof(IsFontBold))
                {
                    setting.IsFontBold = IsFontBold;
                }
                else if (e.PropertyName == nameof(IsFontItalic))
                {
                    setting.IsFontItalic = IsFontItalic;
                }
            };

            PropertyChangedEventManager.AddHandler(setting, OnModelPropertyChanged, string.Empty);
        }
Пример #6
0
        private void AssignToSetting(IChatWindowTextSetting setting)
        {
            PropertyChanged += (_, e) =>
            {
                if (e.PropertyName == nameof(FontSize))
                {
                    setting.FontSize = FontSize;
                }
                else if (e.PropertyName == nameof(FontFamilyName))
                {
                    setting.FontFamilyName = FontFamilyName;
                }
                else if (e.PropertyName == nameof(IsFontBold))
                {
                    setting.IsFontBold = IsFontBold;
                }
                else if (e.PropertyName == nameof(IsFontItalic))
                {
                    setting.IsFontItalic = IsFontItalic;
                }
            };

            PropertyChangedEventManager.AddHandler(setting, OnModelPropertyChanged, string.Empty);

        }