public DemoDataViewModel() { this.ItemsSourceList = new ObservableCollection <SomePointList>(); var first = new SomePointList(0); for (int i = 0; i < 30; i++) { var v = i / 1.0; var y = Math.Abs(v) < 1e-10 ? 1 : Math.Sin(v) / v; var pt = new SomePoint(v, y); first.DataList.Add(pt); } this.ItemsSourceList.Add(first); for (int i = 1; i < 3; i++) { var list = new SomePointList(i); double yOffset = i * 0.5; foreach (var item in first.DataList) { list.DataList.Add(new SomePoint(item.t, item.Y + yOffset)); } ItemsSourceList.Add(list); } }
private void PopupListBoxXaml_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) { Index = PopupListBoxXaml.SelectedIndex; this.Popup1.IsOpen = false; ModeDetailVar.SModeDetail = ItemsSourceList.ElementAt(Index).SModeText; if (this.MouseButtonChanged != null) { this.MouseButtonChanged(this, e); } }