private void AddGoToParentButton(LineageCoords plot) { //if the lineage occurs more than 3/4 of the way to the right of the canvas, plot the buttons to the left of the line bool plotToLeft = plot.AbsoluteXStart > TreeCanvas.ActualWidth * 0.85; int xOffset = plotToLeft ? -100 : 20; var button = new GoToParentButton(); button.Name = "GoToParentButton"; button.Click += GotoParentButton_Click; Canvas.SetTop(button, plot.AbsoluteYStart - 40); Canvas.SetLeft(button, plot.AbsoluteXStart + xOffset); TreeCanvas.Children.Add(button); }
private void AddResetButton(LineageCoords plot) { //if the lineage occurs more than 3/4 of the way to the right of the canvas, plot the buttons to the left of the line bool plotToLeft = plot.AbsoluteXStart > TreeCanvas.ActualWidth * 0.85; int xOffset = plotToLeft ? -60 : 60; var rButton = new ResetButton(); rButton.Name = "ResetButton"; rButton.Click += ResetButton_Click; Canvas.SetTop(rButton, plot.AbsoluteYStart - 40); Canvas.SetLeft(rButton, plot.AbsoluteXStart + xOffset); TreeCanvas.Children.Add(rButton); }
public LineageControl(LineageCoords lineageInfo) : this() { DataContext = lineageInfo; }