MainView.xaml.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. }
  32. public class CollectionLastIndexConverter : IValueConverter
  33. {
  34. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  35. {
  36. return (int)value - 1;
  37. }
  38. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  39. {
  40. throw new NotImplementedException();
  41. }
  42. }
  43. public class DateTimeToTextConverter : IValueConverter
  44. {
  45. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  46. {
  47. return ((DateTime)value).ToString("HH:mm:ss.fff");
  48. }
  49. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  50. {
  51. throw new NotImplementedException();
  52. }
  53. }
  54. }