private void btnAddTarget_Click(object sender, RoutedEventArgs e) { AddEncodingTargetWindow addTargetWindow = new AddEncodingTargetWindow(); addTargetWindow.Owner = this; if (addTargetWindow.ShowDialog() == true) { EncodingTarget encodingTarget = new EncodingTarget() { TargetDirectory = addTargetWindow.TargetDirectory, FileNamingPattern = addTargetWindow.FileNamingPattern, Mp3Settings = new EncodingTargetMp3Settings() { VbrQuality = addTargetWindow.VbrQuality } }; this.CollectionManager.Settings.EncodingTargets.Add(encodingTarget); this.items.Add(this.CreateListViewItemFromTarget(encodingTarget)); } }