ParamsSetPage.xaml.cs 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using MuchInfo.Chart.Data.Models;
  2. using System.Collections.Generic;
  3. using System.Windows;
  4. namespace MuchInfo.Chart.FormulaEdit
  5. {
  6. /// <summary>
  7. /// ParamsSetPage.xaml 的交互逻辑
  8. /// </summary>
  9. public partial class ParamsSetPage : Window
  10. {
  11. public ParamsSetPage(List<ProgramModel> editModels)
  12. {
  13. InitializeComponent();
  14. this.DataContext = new EditFormulaViewModel(editModels);
  15. }
  16. private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
  17. {
  18. var editFormula = this.DataContext as EditFormulaViewModel;
  19. if (editFormula != null)
  20. {
  21. editFormula.ChangeParam();
  22. this.DialogResult = true;
  23. }
  24. }
  25. private void btnCancel_OnClick(object sender, RoutedEventArgs e)
  26. {
  27. // throw new System.NotImplementedException();
  28. this.DialogResult = false;
  29. }
  30. private void btnEditFormula_OnClick(object sender, RoutedEventArgs e)
  31. {
  32. // throw new System.NotImplementedException();
  33. var editFormula = this.DataContext as EditFormulaViewModel;
  34. if (editFormula != null)
  35. {
  36. editFormula.EditFormula();
  37. //editFormula.OpenEditer();
  38. }
  39. }
  40. }
  41. }