private void GetMessages() { var messages = _chatManager.GetMessages(SelectedUser.Id); messageMainStackPanel.Children.Clear(); foreach (var message in messages) { var IsCurrent = message.UserIdTo == SelectedUser.Id; messageMainStackPanel.Children.Add(PageTemplates.AddMessageTemplate(IsCurrent ? SessionInfo.CurrentUserInfo.UserName : SelectedUser.UserName, message.Text, IsCurrent)); } }
private void GetMessages() { messagesMainStackPanel.Children.Clear(); var messages = _chatManager.GetMessages(SelectedUser.Id); if (messages != null) { foreach (var message in messages) { var isSelectedUser = message.UserIdTo == SelectedUser.Id; messagesMainStackPanel.Children.Add(PageTemplates.AddMessageTemplate(isSelectedUser ? SessionInfo.CurrentUserInfo.UserName : SelectedUser.UserName, message.Text, isSelectedUser)); } } }