public AlbumWindow()
 {
     InitializeComponent();
     photoViewer        = new PhotoViewerWindow();
     saveAlbum          = new SaveAlbumAsWindow();
     Images             = new List <BitmapImage>();
     add.IsEnabled      = false;
     loading.Visibility = Visibility.Hidden;
     //bar.Visibility = Visibility.Hidden;
 }
        private void ListBox_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (!Images.Any())
            {
                return;
            }
            BitmapImage selectedImage = (BitmapImage)listBox.SelectedItem;

            if (photoViewer == null || photoViewer.IsClosed)
            {
                photoViewer = new PhotoViewerWindow(selectedImage);
            }
            else
            {
                photoViewer.image.Source = selectedImage;
            }

            if (listBox.SelectedItem == null)
            {
                return;
            }
            photoViewer.Show();
        }