示例#1
0
        public InterlocutorChatViewModel(IFrameViewModel frame, Interlocutor interlocutor)
        {
            _frame = frame;
            _interlocutor = interlocutor;

            var chatDocument = new FlowDocument();
            ChatTextBox = new RichTextBox(chatDocument);
            ChatTextBox.IsDocumentEnabled = true;
            ChatTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            ChatTextBox.Background = Brushes.Transparent;
            ChatTextBox.IsReadOnly = true;
            _conversationThread = CreateThread(chatDocument);

            MessageTextBox = new RichTextBox(new FlowDocument());
            MessageTextBox.IsDocumentEnabled = true;
            MessageTextBox.Background = Brushes.Transparent;
            MessageTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            ParseCurrentHistory();
            SetTheme(ThemeManager.ActiveTheme);
            SetCommands();
            _historyLoader = CreateHistoryLoader();
        }
示例#2
0
        public RoomChatViewModel(IFrameViewModel frame, Room room)
        {
            _frame = frame;
            _room = room;

            var chatDocument = new FlowDocument();
            ChatTextBox = new RichTextBox(chatDocument);
            ChatTextBox.IsDocumentEnabled = true;
            ChatTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;
            ChatTextBox.Background = System.Windows.Media.Brushes.Transparent;
            ChatTextBox.IsReadOnly = true;
            _conversationThread = CreateThread(chatDocument);

            MessageTextBox = new RichTextBox(new FlowDocument());
            MessageTextBox.IsDocumentEnabled = true;
            MessageTextBox.Background = System.Windows.Media.Brushes.Transparent;
            MessageTextBox.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;

            ParseCurrentHistory();
            SetTheme(ThemeManager.ActiveTheme);

            _historyLoader = CreateHistoryLoader();
        }
示例#3
0
 private ConversationThread CreateThread(FlowDocument document)
 {
     _thread = new ConversationThread(document);
     return _thread;
 }
示例#4
0
 public HistoryLoaderViewModel(Guid clientId, Jid withEntity, ConversationThread conversationThread)
 {
     _clientId = clientId;
     _withEntity = withEntity;
     _conversationThread = conversationThread;
 }