aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Converters
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2019-02-13 20:02:59 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2019-02-13 20:02:59 +0200
commit69c55f54ee7217f16419049a311ce437d3c19157 (patch)
tree2c0c25115e07ad4eba5dd4bb4c150fe6d1f0c702 /Software/Visual_Studio/Tango.SharedUI/Converters
parent7b371c15dfb48c5182bbb704b5ea1ff1385b1d30 (diff)
downloadTango-69c55f54ee7217f16419049a311ce437d3c19157.tar.gz
Tango-69c55f54ee7217f16419049a311ce437d3c19157.zip
Fixed issue with PPC WIFI connection profiles.
Implemented OS restart after first setup. Prevented PPC updater crashes without restarting PPC. Implemented restarting system view on PPC.
Diffstat (limited to 'Software/Visual_Studio/Tango.SharedUI/Converters')
-rw-r--r--Software/Visual_Studio/Tango.SharedUI/Converters/EnumToBooleanConverter.cs43
1 files changed, 43 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToBooleanConverter.cs b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToBooleanConverter.cs
new file mode 100644
index 000000000..567d79c5a
--- /dev/null
+++ b/Software/Visual_Studio/Tango.SharedUI/Converters/EnumToBooleanConverter.cs
@@ -0,0 +1,43 @@
+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 EnumToBooleanConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if (parameter != null)
+ {
+ if (parameter is String)
+ {
+ if (parameter.ToString().Contains(","))
+ {
+ String[] values = parameter.ToString().Split(',');
+ return values.Contains(value.ToString()) ? true : false;
+ }
+ else
+ {
+ return value.ToString() == parameter.ToString() ? true : false;
+ }
+ }
+ else
+ {
+ return value == parameter ? true : false;
+ }
+ }
+
+ return false;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}