//根据选中日期画图 private void DrawTheDay(object sender, RoutedEventArgs e) { ClearCanvas(); try { DrawPre.getListd(viewModel.NotesList, calendar.SelectedDate.Value); Draw(); } catch (System.InvalidOperationException) { Xceed.Wpf.Toolkit.MessageBox.Show("必须要选中某个日期!"); } }
//将扇形和图例添加到画板中 private void Draw() { var shapes = DrawPre.GetShapes(); var labels = DrawPre.getLabel(); foreach (var shape in shapes) { this.canvas.Children.Add(shape); } foreach (var item in labels) { this.wrap.Children.Add(item); } }
//当前日期画图 private void DrawDay(object sender, RoutedEventArgs e) { ClearCanvas(); DrawPre.getListd(viewModel.NotesList, DateTime.Now); Draw(); }
//清空画板,重置列表 private void ClearCanvas() { this.canvas.Children.Clear(); this.wrap.Children.Clear(); DrawPre.ClearUp(); }
//画所有的 private void Draw_Click(object sender, RoutedEventArgs e) { ClearCanvas(); DrawPre.getList(viewModel.NotesList); Draw(); }