private void ScallingBtn_Click(object sender, RoutedEventArgs e) { if (IsLoaded) { if (KeysPressed.Contains(Key.LeftShift)) { Graph.Xmap = 0.01; Graph.Ymap = 0.01; Graph.DrawCartesian(); Graph.DrawGrid(); } else { switch (Graph.ScallingMode) { case ScallingMode.Both: Graph.ScallingMode = ScallingMode.X; ScallingBtn.Content = "→"; break; case ScallingMode.X: Graph.ScallingMode = ScallingMode.Y; ScallingBtn.Content = "↑"; break; case ScallingMode.Y: Graph.ScallingMode = ScallingMode.Both; ScallingBtn.Content = "∟"; break; } } } }
private void MovingBtn_Click(object sender, RoutedEventArgs e) { if (IsLoaded) { if (KeysPressed.Contains(Key.LeftShift)) { Graph.Origin = new Point(Graph.DrawingArea.ActualWidth / 2, Graph.DrawingArea.ActualHeight / 2); Graph.DrawCartesian(); Graph.DrawGrid(); } else { switch (Graph.MovingMode) { case MovingMode.Both: Graph.MovingMode = MovingMode.X; MovingBtn.Content = "►"; break; case MovingMode.X: Graph.MovingMode = MovingMode.Y; MovingBtn.Content = "▲"; break; case MovingMode.Y: Graph.MovingMode = MovingMode.Both; MovingBtn.Content = "+"; break; } } } }
private void GridBtn_Click(object sender, RoutedEventArgs e) { Graph.DrawingGrid = !Graph.DrawingGrid; if (Graph.DrawingGrid) { GridBtn.Content = "ON"; Graph.DrawGrid(); } else { GridBtn.Content = "OFF"; Graph.ClearGrid(); } }