private void RemoveMessage(Message message) { foreach (Message item in _messages) { if (item.MessageId == message.MessageId && item.MessageType == message.MessageType) { _messages.Remove(item); Console.WriteLine("Message removed. Messages: " + _messages.Count); return; } } }
public void RemoveMessage(Common.PlatformEssentials.MessageType type, string message) { var messageType = (MessageType)type; var m = new Message(messageType, message, 1); Application.Current.Dispatcher.Invoke(() => { if (_messageViewModel.RemoveMessageCommand.CanExecute(m)) { _messageViewModel.RemoveMessageCommand.Execute(m); } }); }
private void AddMessage(Message message) { _messages.Add(message); Console.WriteLine("Message added. Messages: " + _messages.Count); MessagesView.MoveCurrentToPosition(0); }