public void InitializeMedia() { var app = MainWindow.chatApplication; if (app.model.MediaMessages.ContainsKey(ConversationID)) { var medias = app.model.MediaMessages[ConversationID]; for (int i = 0; i < medias.Count; ++i) { var media = medias[i]; MediaPlayer.AddMediaItem ( conversationID: ConversationID, fileID: media.FileID, fileName: media.FileName, position: medias.Count - i - 1 ); } } else { app.model.MediaMessages.Add(ConversationID, new List <Utils.MediaPack>()); } MediaPlayer.ConversationID = ConversationID; }