public AddChartWindow(TargetChartItem item, bool forEdit)
     : base()
 {
     InitializeComponent();
     var model = new ChartEditModel(item, forEdit);
     model.Load();
     AddChartForm.DataContext = model;
     CommonHelper.InitValidation(NameInput, CoeffInput, ColorComboBox);
     NameInput.Focus();
 }
示例#2
0
 public ChartEditModel(TargetChartItem item, bool forEdit)
     : base()
 {
     connectNeed = false;
     ForEdit = forEdit;
     Item = item;
     Name = "";
     Coeff = "";
     Color = null;
 }
 private void AddChartButton_Click(object sender, RoutedEventArgs e)
 {
     var item = new TargetChartItem();
     var addChartWindow = new AddChartWindow(item, false) { Owner = MainWindow };
     if (addChartWindow.ShowDialog() == true)
     {
         Model.AddChartList.Add(item);
         Model.SortAddChartList();
         AddChartList.SelectedItem = item;
     }
 }