private static void InputChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FileRenamer fr = d as FileRenamer; var current = e.NewValue as ObservableCollection <string>; var old = e.OldValue as ObservableCollection <string>; if (old != null) { old.CollectionChanged -= fr.InputCollectionChanged; } else { current.CollectionChanged += fr.InputCollectionChanged; } }
private static void DPChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { FileRenamer fr = d as FileRenamer; if (string.IsNullOrEmpty(fr.OutputFolder) || !System.IO.Directory.Exists(fr.OutputFolder)) { fr.IsOutputFolderExists = false; } else { fr.IsOutputFolderExists = true; } fr.ProcessTags(); }