//internal variables // public Curve(Graph graph, CartesianTable table) { this.graph = graph; this.table = table; table.Update += new CartesianTable.TableUpdatedEventHandler(OnUpdate); _GeneratePoints(); }
public MainWindow() { InitializeComponent(); Loaded += delegate { Graph newGraph = new Graph("x^2"); Console.WriteLine(newGraph.ToString()); /* foreach(Point point in newGraph.GetPoints() ) Console.WriteLine(point.ToString()+"," ); */ CartesianTable table = new CartesianTable(canvas, this); Curve curve = new Curve(newGraph, table); Console.WriteLine(curve.ToString()); table.Refresh(); }; }
public void OnUpdate(CartesianTable table, EventArgs e) { Console.WriteLine(table.XMod); _GeneratePoints(); _Draw(); }