diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-12 20:38:57 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2020-11-12 20:38:57 +0200 |
| commit | 14e4bd850fa6730eecd7d15bd7044f364b41c986 (patch) | |
| tree | 4e1945a18def6d1c91f239b2b4dbf6e11c0d51db /Software/Visual_Studio/Tango.SharedUI/Converters | |
| parent | 775f0015321f91aa5be3aca079e289e89d4719f5 (diff) | |
| download | Tango-14e4bd850fa6730eecd7d15bd7044f364b41c986.tar.gz Tango-14e4bd850fa6730eecd7d15bd7044f364b41c986.zip | |
Working on data store view.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters')
| -rw-r--r-- | Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs index c551f7d49..5c725e524 100644 --- a/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs +++ b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToItemsSourceConverter.cs @@ -10,6 +10,17 @@ namespace Tango.SharedUI.Converters { public class EnumToItemsSourceConverter : IValueConverter { + public class EnumValue + { + public Object Value { get; set; } + public String DisplayName { get; set; } + + public override string ToString() + { + return DisplayName; + } + } + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Type result = value as Type; @@ -20,7 +31,7 @@ namespace Tango.SharedUI.Converters } else { - return Enum.GetValues(result).Cast<object>().Select(e => new { Value = e, DisplayName = (e as Enum).ToDescription() }).ToList(); + return Enum.GetValues(result).Cast<object>().Select(e => new EnumValue() { Value = e, DisplayName = (e as Enum).ToDescription() }).ToList(); } } |
