private void menu_media_Click(object sender, RoutedEventArgs e)
        {
            UserControl uc_Media = null;
            List<MediaModel> listVernis = new List<MediaModel>();
            try
            {
                if (MainWindow.Connexion.State == System.Data.ConnectionState.Open)
                {
                    string query = "SELECT * FROM media WHERE id_user=" + UtilisateurSelected.Id ;
                    MySqlCommand cmd = new MySqlCommand(query, MainWindow.Connexion);

                    MySqlDataReader dataReader = cmd.ExecuteReader();

                    //Read the data and store them in the list
                    while (dataReader.Read())
                    {
                        listVernis.Add(new MediaModel(dataReader));
                    }

                    dataReader.Close();

                    if (listVernis != null)
                        uc_Media = new Media(listVernis, false, UtilisateurSelected.Id);

                    if (uc_Media != null)
                    {
                        var apercu = new ApercuWindows();
                        apercu.Uc_Apercu = uc_Media;
                        apercu.Height = 600;
                        apercu.Width = 800;
                        apercu.Show();
                    }
                }
            }
            catch (MySql.Data.MySqlClient.MySqlException ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
 private void DataGrid_PreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
 {
     if (MediaSelected != null)
     {
         var apercu = new ApercuWindows();
         apercu.Uc_Apercu = new ApercuMedia(MediaSelected);
         apercu.Height = 600;
         apercu.Width = 560;
         apercu.Show();
     }
 }