WinSupplyAssetSelector.xaml.cs 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. 
  2. ///////////////////////////////////////////////////////////////////////////////
  3. //文件名称: WinSupplyAssetSelecter.xaml
  4. //文件描述: WinSupplyAssetSelecter.xaml
  5. //创 建 者: xls
  6. //创建日期: 2018/9/12 22:33:38
  7. //版 本 号:1.0.0.0
  8. ////////////////////////////////////////////////////////////////////////////////
  9. using System;
  10. using System.Windows;
  11. using System.Windows.Controls;
  12. using FWindSoft.Wpf;
  13. namespace Com.FirmLib.UI.Seller
  14. {
  15. /// <summary>
  16. /// WinSupplyAssetSelecter.xaml 的交互逻辑
  17. /// </summary>
  18. public partial class WinSupplyAssetSelector : BaseWindow
  19. {
  20. private VmSupplyAssetSelector m_Vm;
  21. public WinSupplyAssetSelector() : this(new VmSupplyAssetSelector())
  22. {
  23. InitializeComponent();
  24. }
  25. public WinSupplyAssetSelector(VmSupplyAssetSelector vm)
  26. {
  27. InitializeComponent();
  28. this.m_Vm = vm;
  29. this.m_Vm.SetRefView(this);
  30. this.DataContext = this.m_Vm;
  31. }
  32. protected override void LoadData(LoadParameter parameter)
  33. {
  34. //初始化数据
  35. TryCatchWrapper.Handled(() => this.m_Vm.Init(parameter));
  36. }
  37. #region 界面关联事件
  38. private void btnOK_Click(object sender, RoutedEventArgs e)
  39. {
  40. try
  41. {
  42. if (this.HasError())
  43. {
  44. //MessageShow.Infomation("请修改错误输入项");
  45. return;
  46. }
  47. }
  48. catch (Exception ex)
  49. {
  50. //MessageShow.Show(ex);
  51. }
  52. }
  53. private void btnCancel_Click(object sender, RoutedEventArgs e)
  54. {
  55. Close();
  56. }
  57. private void TabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
  58. {
  59. System.Windows.Controls.TabControl control = e.OriginalSource as TabControl;
  60. if (control == null)
  61. return;
  62. this.m_Vm.TabChangedCommand(control.SelectedIndex);
  63. }
  64. #endregion
  65. }
  66. }