/// <summary> /// Constructs the chat portion of the control. /// </summary> private void ConstructChat() { var chatBorder = new Border() { BorderBrush = Brushes.DarkGray, Background = Brushes.DimGray, BorderThickness = new Thickness(1), Padding = new Thickness(3), Width = 603, Height = 253, MaxWidth = 603, MaxHeight = 253, HorizontalAlignment = HorizontalAlignment.Left }; var chatControl = new ChatControl { Width = 600, Height = 250 }; chatBorder.Child = chatControl; this.Content = chatBorder; if (this.room != null) { chatControl.SetRoom(this.room); } }
public void MoveToWindow(ChatControl chat) { lock (Locker) { var win = new ChatWindow(chat); WindowManager.ChatWindows.Add(win); win.Show(); } }
public void AddChat(ChatControl chat) { if (!Dispatcher.CheckAccess()) { Dispatcher.Invoke(new Action(() => this.AddChat(chat))); return; } var chatBarItem = new ChatBarItem(chat) { Height = this.barHeight.Value }; chatBarItem.HeaderMouseUp += ChatBarItemOnPreviewMouseUp; this.Items.Add(chatBarItem); Sounds.PlayMessageSound(); this.SelectedItem = chatBarItem; }
public ChatWindow(ChatControl control) { Room = control.Room; this.Activated += OnActivated; this.Closing += OnClosing; InitializeComponent(); this.Title = Room.IsGroupChat ? Room.GroupUser.UserName : Room.Users.First(x => x != Program.LobbyClient.Me).UserName; Room.OnUserListChange += RoomOnOnUserListChange; var chatParent = this.ChatControl.Parent as Panel; chatParent.Children.Remove(this.ChatControl); ChatControl = control; ChatControl.Width = Double.NaN; ChatControl.Height = Double.NaN; Grid.SetRow(ChatControl,1); ChatControl.VerticalAlignment = VerticalAlignment.Stretch; ChatControl.HorizontalAlignment = HorizontalAlignment.Stretch; chatParent.Children.Add(ChatControl); }
public void MoveToChatBar(ChatControl chat) { lock(Locker) ChatBar.AddChat(chat); }
/// <summary> /// Constructs the chat portion of the control. /// </summary> private void ConstructChat() { var chatBorder = new Border() { BorderBrush = Brushes.DarkGray, Background = Brushes.DimGray, BorderThickness = new Thickness(1), Padding = new Thickness(3), Width = 603, Height = 253, MaxWidth = 603, MaxHeight = 253, HorizontalAlignment = HorizontalAlignment.Left }; chatControl = new ChatControl { Width = 600, Height = 250 }; chatBorder.Child = chatControl; this.Content = chatBorder; if (this.Room != null) { chatControl.SetRoom(this.Room); } }
public ChatBarItem(ChatControl control) { Room = control.Room; chatControl = control; this.ConstructControl(); }