UIConverters.cs 799 B

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Data;
  8. using Aitex.Core.UI.ControlDataContext;
  9. namespace MECF.Framework.Simulator.Core.Commons
  10. {
  11. public class ConnectionStatusBackgroundConverter : IValueConverter
  12. {
  13. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  14. {
  15. bool isConnected = value != null && (bool) value;
  16. return isConnected ? "Green" : "Yellow";
  17. }
  18. public object ConvertBack(object value, Type targetTypes, object parameter, System.Globalization.CultureInfo culture)
  19. {
  20. return null;
  21. }
  22. }
  23. }