private void chkDirected_Click(object sender, RoutedEventArgs e) { if ((chkDirected.IsChecked == null) || (chkDirected.IsChecked.Value == false)) { foreach (arc a in arcs) { a.directed = false; ((ArcShape)a.DisplayShape.Shape).directed = false; gui.ArcPropertyChanged(a); } } else { foreach (arc a in arcs) { /* this next line is a bit strange. but I want to make sure that if an * arc is switching from undirected to directed, it shows up this way on * the screen. The user can always click to hide the arrow heads - I feel * this is the better UI decision. The reason it is done first is that we want * to only do this for arcs that are switching from undirected to directed. */ if (!a.directed) { ((ArcShape)a.DisplayShape.Shape).ShowArrowHeads = true; } a.directed = true; ((ArcShape)a.DisplayShape.Shape).directed = true; gui.ArcPropertyChanged(a); } } Update(); }
private void StrokeColor_ValueChanged(object sender, RoutedEventArgs e) { foreach (arc a in arcs) { a.DisplayShape.Stroke = StrokeColorSelector.Value; gui.ArcPropertyChanged(a); } }