private void List_Selection(object sender, SelectionChangedEventArgs e) { Common.Model.Medication med = MedicationList.SelectedItem as Common.Model.Medication; if (med != null) { var window = new SelectedMedication(med) { Owner = (Window)PresentationSource.FromVisual(this).RootVisual }; window.Closed += Window_Closed; window.ShowDialog(); MedicationList.UnselectAll(); } if (!string.IsNullOrEmpty(SearchTextBox.Text)) { SearchTextBox.Text = string.Empty; } }
public SelectedMedication(Common.Model.Medication med) { InitializeComponent(); medication = med; SetupShownDatas(); }