WinMaintainerAssetSelector.xaml.cs 2.1 KB

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