private static void OnTbTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { string newTxt = e.NewValue as string; FilePathControl ctrl = (FilePathControl)d; if (ctrl.FilePath == null || ctrl.FilePath.PathRelativeToParentFile != newTxt) { ctrl.FilePath = L3dFilePath.CreateRelativeToFile(newTxt, ctrl.FilePath != null ? ctrl.FilePath.ParentFile : null); } }
private static void OnFilePathChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { L3dFilePath newPath = e.NewValue as L3dFilePath; FilePathControl ctrl = (FilePathControl)d; if (!L3dFilePath.Equals(newPath, ctrl._curPath)) { ctrl._curPath = newPath; ctrl.ValidateCurrentPath(); } }
private static void OnFileDialogFiltersChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { IEnumerable <CommonFileDialogFilter> newVal = e.NewValue as IEnumerable <CommonFileDialogFilter>; FilePathControl ctrl = (FilePathControl)d; if (newVal != null) { ctrl._possibleExtensions = newVal.SelectMany(el => el.Extensions).Distinct(); } else { ctrl._possibleExtensions = Enumerable.Empty <string>(); } }