private void fitButton_Click(object sender, RoutedEventArgs e) { Rect union = Rect.Empty; foreach (DiagramNode node in DD.Nodes) { if (union.IsEmpty) { union = node.Bounds; } else { union.Union(node.Bounds); } } union.Inflate(50, 50); DD.ZoomToRect(union); }
public void FitSize() { Rect union = Rect.Empty; foreach (DiagramNode node in DD.Nodes) { if (union.IsEmpty) { union = node.Bounds; } else { union.Union(node.Bounds); } } union.Inflate(50, 50); DD.ZoomToRect(union); }