public UserInfo(DockPanel parent, ChatInfoModel model) { InitializeComponent(); CurrentUser = model.ContactMsgGetter; this.parent = parent; this.DataContext = model; }
public ChatWindow(ChatInfoModel chatInfoModel, ZaolisServiceClient.ZaolisServiceClient client, DockPanel dockPanel) { InitializeComponent(); this.ChatInfo = chatInfoModel; this.DataContext = ChatInfo; this.client = client; OverlayDockPanel = dockPanel; ScrollViewer.ScrollToBottom(); }
public void LoadChat(ChatInfoModel chatInfoModel, ZaolisServiceClient.ZaolisServiceClient client, DockPanel OverlayDockPanel) { if (IsLoadedChat(chatInfoModel.Chat)) { var chatwindow = chatWindows.FirstOrDefault(c => c.Chat.Id == chatInfoModel.Chat.Id); chatWindows.Remove(chatwindow); chatWindows.Insert(0, chatwindow); } else { if (chatWindows.Count == MaxCount) { chatWindows.RemoveAt(MaxCount - 1); } chatWindows.Insert(0, new ChatWindow(chatInfoModel, client, OverlayDockPanel)); } }