private void CreateWeightGraph(int numberOfEntries) { var weight = json.DeserializeGewichtTag(); var jsonLenght = weight.Count; MyValues.Clear(); TypeOfGraph.Title = "Gewicht"; if (jsonLenght == 0) { return; } var helper = jsonLenght - numberOfEntries - 1; for (int i = 0; i <= numberOfEntries - 1; i++) { if (i >= jsonLenght) { break; } if (jsonLenght <= numberOfEntries) { MyValues.Add(new ObservableValue(weight[i].TodaysWeight)); } else { MyValues.Add(new ObservableValue(weight[helper + i].TodaysWeight)); } } }
private void CreateCaloriesGraph(int numberOfEntries) { var calories = json.DeserializeKalorienTag(); var jsonLenght = calories.Count; MyValues.Clear(); TypeOfGraph.Title = "Kalorien"; if (calories.Count == 0) { return; } var helper = jsonLenght - numberOfEntries - 1; for (int i = 0; i <= numberOfEntries - 1; i++) { if (i >= jsonLenght) { break; } if (jsonLenght <= numberOfEntries) { MyValues.Add(new ObservableValue(calories[i].CaloriesDay)); } else { MyValues.Add(new ObservableValue(calories[helper + i].CaloriesDay)); } } }
public ToDoListViewModel() { _model.PropertyChanged += (s, e) => { OnPropertyChanged(e.PropertyName); }; Delete = new Command <object>(i => { _model.RemoveValue(i); }); Add = new Command <string>(str => { _model.AddValue(str); InputText = string.Empty; OnPropertyChanged("InputText"); Console.Write(MyValues); }); MyValues.Add("qwdqwd"); }
private void AddPointOnClick(object sender, RoutedEventArgs e) { var r = new Random(); MyValues.Add(new ObservableValue(r.Next(-20, 20))); }