aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs
new file mode 100644
index 000000000..7c59f8de7
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/FilePathToFileNameConverter.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.IO;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Tango.SharedUI.Converters
+{
+ public class FilePathToFileNameConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ try
+ {
+ if (value != null)
+ {
+ return Path.GetFileName(value.ToString());
+ }
+ }
+ catch
+ {
+ return value;
+ }
+
+ return value;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}