Beispiel #1
0
        private void listBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            Messages.Clear();
            var conversationModel = (ConversationModel)e.AddedItems[0];
            var massages          = _common.GetMassagesByConversationId(conversationModel?.Id ?? 0).ToList();

            foreach (var message in massages)
            {
                if (message == null)
                {
                    continue;
                }
                Messages.Add(new MessageEventArgsModel
                {
                    Id   = message.Id,
                    Text = message.Text
                });
            }
            textBox.ItemsSource = Messages;
        }