/* * the constructor gets a string p that changes the behavior of the instance accordingly (further details in setup method). * It also initialize the fields with the same values (exept property) since it dont matter from one instance to another. */ public OxyViewModel(IAnomalyGraphModel a, string p) { ls = new LineSeries(); ls.Color = OxyColors.Blue; //setCorrectLegend(); //thickness normal = new ScatterSeries(); normal.MarkerFill = OxyColors.Blue; normal.MarkerStrokeThickness = 0.005; normal.MarkerType = MarkerType.Circle; aNormal = new ScatterSeries(); aNormal.MarkerFill = OxyColors.Red; aNormal.MarkerStrokeThickness = 0.005; aNormal.MarkerType = MarkerType.Circle; objectCor = new LineSeries(); objectCor.Color = OxyColors.Black; anomalyGraphModel = a; property = p; anomalyGraphModel.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { if (property == e.PropertyName) { setCorrectOption(); this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property)); } }; }
public AnomalySelectViewModel(IAnomalyGraphModel model) { this.model = model; model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e) { NotifyPropertyChanged("VM_" + e.PropertyName); }; }