public ChatWindow(GwupeClientAppContext appContext, EngagementWindow engagementWindow) { this.InitializeComponent(); _appContext = appContext; _engagementWindow = engagementWindow; Chat = _engagementWindow.Engagement.Functions["Chat"] as Function; Chat.NewActivity += ChatOnNewMessage; ChatPanelViewer.ScrollToBottom(); DataContext = new ChatWindowDataContext(_appContext, this); // need to do this here, because we get weird errors if its part of the data context. ChatPanel.ItemsSource = new DispatchingCollection <ObservableCollection <IChatMessage>, IChatMessage>(Chat.Conversation.Exchange, Dispatcher); }
public ChatWindow(GwupeClientAppContext appContext, EngagementWindow engagementWindow) { this.InitializeComponent(); _appContext = appContext; _engagementWindow = engagementWindow; Chat = _engagementWindow.Engagement.Functions["Chat"] as Function; Chat.NewActivity += ChatOnNewMessage; ChatPanelViewer.ScrollToBottom(); DataContext = new ChatWindowDataContext(_appContext, this); // need to do this here, because we get weird errors if its part of the data context. ChatPanel.ItemsSource = new DispatchingCollection<ObservableCollection<IChatMessage>, IChatMessage>(Chat.Conversation.Exchange, Dispatcher); }