GetDateWindow.xaml.cs 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace ivf_tl_Operate.Windows
  15. {
  16. /// <summary>
  17. /// GetDateWindow.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class GetDateWindow : Window
  20. {
  21. public string Date { get; private set; } = string.Empty;
  22. public bool isClos = true;
  23. public GetDateWindow(Window w)
  24. {
  25. InitializeComponent();
  26. this.Owner = w;
  27. _dateControl.SelectDateAction += _dateControl_SelectDateAction;
  28. _dateControl.CloseAction += _dateControl_CloseAction;
  29. _dateControl.isNYR = true;
  30. //this.Loaded += (s, e) =>
  31. //{
  32. // AppData.Instance.MainWindow.Mark(true);
  33. //};
  34. //this.Closing += (s, e) =>
  35. //{
  36. // if (isClos)
  37. // {
  38. // AppData.Instance.MainWindow.Mark(false);
  39. // }
  40. //};
  41. }
  42. public void SetSelectTime(DateTime currentDate)
  43. {
  44. _dateControl.SetSelectTime(currentDate);
  45. }
  46. public void SetSelectWeiLai()
  47. {
  48. _dateControl.SetSelectWeiLai();
  49. }
  50. private void _dateControl_CloseAction(object obj)
  51. {
  52. Close();
  53. }
  54. private void _dateControl_SelectDateAction(string obj)
  55. {
  56. Date = obj;
  57. DialogResult = true;
  58. }
  59. }
  60. }