예제 #1
0
        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);
            }
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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>();
            }
        }