aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Converters
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-06-21 15:58:30 +0300
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-06-21 15:58:30 +0300
commit9416831e9b6cd73216aedfe14aa96220c30e7c3c (patch)
treea16c179aad50288b6a582e7e9366f337b1eae2e1 /Software/Visual_Studio/Tango.SharedUI/Converters
parent0ba98d08cb6cb95b620ee7182387fb3b1457e830 (diff)
downloadTango-9416831e9b6cd73216aedfe14aa96220c30e7c3c.tar.gz
Tango-9416831e9b6cd73216aedfe14aa96220c30e7c3c.zip
Working on PPC...
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs36
1 files changed, 36 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs
new file mode 100644
index 000000000..6e0a75df5
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/DisplayMemberPathConverter.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows.Data;
+
+namespace Tango.SharedUI.Converters
+{
+ public class DisplayMemberPathConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (values.Length == 2 && values[0] != null && values[1] != null)
+ {
+ Object obj = values[0];
+ String path = values[1].ToString();
+ return obj.GetPropertyValueByPath(path);
+ }
+ else if (values.Length > 0)
+ {
+ return values[0];
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}