MainView.xaml.cs 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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.Data;
  10. using System.Windows.Documents;
  11. using System.Windows.Input;
  12. using System.Windows.Media;
  13. using System.Windows.Media.Imaging;
  14. using System.Windows.Shapes;
  15. using OpenSEMI.Ctrlib.Window;
  16. using Forms = System.Windows.Forms;
  17. namespace FurnaceGasPanelUI.Client
  18. {
  19. /// <summary>
  20. /// Interaction logic for MainView.xaml
  21. /// </summary>
  22. public partial class MainView : CustomWnd
  23. {
  24. public MainView()
  25. {
  26. InitializeComponent();
  27. }
  28. public void MoveForm()
  29. {
  30. Forms.Screen[] screens = Forms.Screen.AllScreens;
  31. int count = screens.Count();
  32. this.Left = screens[count - 1].Bounds.Left;
  33. this.Top= screens[count - 1].Bounds.Top;
  34. this.WindowState = WindowState.Maximized;
  35. }
  36. private void CustomWnd_Loaded(object sender, RoutedEventArgs e)
  37. {
  38. MoveForm();
  39. }
  40. }
  41. public class CollectionLastIndexConverter : IValueConverter
  42. {
  43. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  44. {
  45. return (int)value - 1;
  46. }
  47. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  48. {
  49. throw new NotImplementedException();
  50. }
  51. }
  52. public class DateTimeToTextConverter : IValueConverter
  53. {
  54. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  55. {
  56. return ((DateTime)value).ToString("HH:mm:ss.fff");
  57. }
  58. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  59. {
  60. throw new NotImplementedException();
  61. }
  62. }
  63. }