private void UpdateMessageDetails() { try { string id = ((AppMessage)MessagesLB.SelectedIndex())?.Id; if (!string.IsNullOrEmpty(id)) { AppMessage message = _messages.GetMessage(id); if (message != null) { MessageListBox.Refresh(); SetMessageDetails(message); ToggleButtons(true, message.Show ? HIDE : SHOW); } } } catch (Exception) { // Something happened } }
private void MessageListBox_SelectedIndexChanged(object sender, EventArgs e) { UpdateMessageDetails(); MessageListBox.Refresh(); }