private void previewMedicineButton_Click(object sender, RoutedEventArgs e)
 {
     if (medicineTable.SelectedIndex >= 0)
     {
         MedicineInformationPreview.GetInstance((Medicine)medicineTable.SelectedItem).ShowDialog();
     }
 }
 public static MedicineInformationPreview GetInstance(Medicine medicineToPreview)
 {
     if (instance == null)
     {
         instance = new MedicineInformationPreview(medicineToPreview);
     }
     return(instance);
 }
 private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
 {
     MedicinePreviewWindow.GetInstance().RefreshTable();
     instance = null;
 }