public bool ShowVisibility(bool randomize) { // find all nodes visible from source node T source = FindSource(randomize); var visibility = new Visibility <T>(Graph); visibility.Threshold = (double)Dialog.ThresholdUpDown.Value; Predicate <T> isOpaque = p => NodeCosts[p] >= MaxCost; bool success = visibility.FindVisible(isOpaque, source); Locations = visibility.Nodes; Renderer.InvalidateVisual(); return(success); }