MainView.xaml.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. namespace VirgoUI.Client
  17. {
  18. /// <summary>
  19. /// Interaction logic for MainView.xaml
  20. /// </summary>
  21. public partial class MainView : CustomWnd
  22. {
  23. public MainView()
  24. {
  25. InitializeComponent();
  26. }
  27. private void TbLoginName_TextChanged(object sender, TextChangedEventArgs e)
  28. {
  29. ((MainViewModel)DataContext).LastLoginName = (sender as TextBox).Text;
  30. }
  31. private void ComboBox_Drop(object sender, DragEventArgs e)
  32. {
  33. }
  34. private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  35. {
  36. }
  37. }
  38. public class CollectionLastIndexConverter : IValueConverter
  39. {
  40. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  41. {
  42. return (int)value - 1;
  43. }
  44. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  45. {
  46. throw new NotImplementedException();
  47. }
  48. }
  49. public class DateTimeToTextConverter : IValueConverter
  50. {
  51. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  52. {
  53. return ((DateTime)value).ToString("HH:mm:ss.fff");
  54. }
  55. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  56. {
  57. throw new NotImplementedException();
  58. }
  59. }
  60. }