/// <summary>
        /// Отмечаем медифайл понравшимся и добавляем в избранное
        /// </summary>
        private void buttom_media_like_Click(object sender, RoutedEventArgs e)
        {
            panel_like.Visibility        = Visibility.Hidden;
            img_LikeOrDislike.Source     = new BitmapImage(new Uri("/png/like_heart.png", UriKind.Relative));
            img_LikeOrDislike.Visibility = Visibility.Visible;

            using (MediaHistoryContext db = new MediaHistoryContext())
            {
                foreach (var mediaFile in db.Media)
                {
                    if (mediaFile.Date.ToString() == mediafileCash.Date.ToString())
                    {
                        mediaFile.Favorite = true;
                    }
                }
                db.SaveChanges();
            }
            object_animation_size(sender, e);
        }
        /// <summary>
        /// Действия при открытии файла
        /// </summary>
        private void MediaPlayer_MediaOpened(object sender, RoutedEventArgs e)
        {
            panel_like.Visibility         = Visibility.Hidden;
            img_LikeOrDislike.Visibility  = Visibility.Hidden;
            img_LikeOrDislike.Opacity     = 1;
            img_LikeOrDislike.Width       = 64;
            img_LikeOrDislike.Height      = 64;
            dockPael_MediaElement.Opacity = 1;
            panel_like.Opacity            = 1;

            try
            {
                MediaPlayer.Volume  = (double)slider_volume.Value;
                slider_seek.Maximum = MediaPlayer.NaturalDuration.TimeSpan.TotalMilliseconds;

                timer.Interval = new TimeSpan(0, 0, 1);
                timer.Start();

                MediaHistory mediafile = new MediaHistory();
                mediafile.Name = System.IO.Path.GetFileName(filename);
                TimeSpan timeSpan = TimeSpan.FromSeconds(Convert.ToInt32(MediaPlayer.NaturalDuration.TimeSpan.TotalSeconds));
                mediafile.Duration = string.Format("{0:D2}:{1:D2}:{2:D2}", timeSpan.Hours, timeSpan.Minutes, timeSpan.Seconds);
                mediafile.Date     = DateTime.Now;
                mediafile.Favorite = false;
                mediafile.Path     = filename;
                mediafileCash      = mediafile;

                using (MediaHistoryContext db = new MediaHistoryContext())
                {
                    db.Media.Add(mediafile);
                    db.SaveChanges();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Ошибка воспроизведения файла!" + ex.Message, "MediaPlayerApp", MessageBoxButton.OK, MessageBoxImage.Error);
                fileIsDrop = false;
                filename   = null;
                buttom_menu_fileOpen_Click(sender, e);
            }
        }
 private void updateButton_Click(object sender, RoutedEventArgs e)
 {
     button_animation_size(updateButton);
     db.SaveChanges();
 }