DBInfoAlarm.xaml.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Globalization;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Windows;
  8. using System.Windows.Controls;
  9. using System.Windows.Controls.Primitives;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace ProximaAnalizer.Views;
  18. /// <summary>
  19. /// Interaction logic for DBInfoAlarm.xaml
  20. /// </summary>
  21. public partial class DBInfoAlarm : UserControl
  22. {
  23. public DBInfoAlarm()
  24. {
  25. InitializeComponent();
  26. }
  27. }
  28. public class MFCUnitConverter : IValueConverter
  29. {
  30. public object? Convert(object? value, Type targetType, object parameter, CultureInfo culture)
  31. {
  32. if (value is not float unit)
  33. return value;
  34. return unit switch
  35. {
  36. 0f => "SCCM",
  37. 1f => "SLM",
  38. _ => value
  39. };
  40. }
  41. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  42. {
  43. throw new NotImplementedException();
  44. }
  45. }
  46. public class LeakCheckNameConvert : IValueConverter
  47. {
  48. public object? Convert(object? value, Type targetType, object parameter, CultureInfo culture)
  49. {
  50. if (value is not string s)
  51. return value;
  52. return s.Replace("LeakCheck", string.Empty);
  53. }
  54. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  55. {
  56. throw new NotImplementedException();
  57. }
  58. }