private void MainRect2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Point currPos = new Point(e.GetPosition(ParamCanvas).X, e.GetPosition(ParamCanvas).Y); ParameterModel model = GetParamModelByCoord(currPos); ObservableCollection<ParameterModel> models = new ObservableCollection<ParameterModel>(); for (int i = 0; i < model.SiblingModels.Length; i++) models.Add(model.SiblingModels[i]); ParamValueEditor valueEditor = new ParamValueEditor() { DataContext = models, }; valueEditor.ParamDataForm.CurrentItem = model; valueEditor.Show(); ParamValueChangesEvent(new EventArgs()); //Commitment was made }
void valueEditor_OnRefresh(object sender, EventArgs e) { ParamValueEditor valueEditor = new ParamValueEditor() { DataContext = currModel, }; valueEditor.OnRefresh += new ParamValueEditor.RefreshEventHandler(valueEditor_OnRefresh); valueEditor.ParamDataForm.CurrentItem = currModel; valueEditor.Show(); }