Graphing Calculator Demo

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

This sample application is a fully featured graphing calculator.

For comprehensive coverage of Windows Presentation Foundation (WPF) and Microsoft .NET Framework application development best practices, refer to the following as appropriate:

Accessibility - Accessibility Best Practices

Security - Windows Presentation Foundation Security

Localization - WPF Globalization and Localization Overview

Building the Sample

  • Install the Windows Software Development Kit (SDK) and open its build environment command window. On the Start menu, point to All Programs, Microsoft Windows SDK, and then click CMD Shell.

  • Download the sample, usually from the software development kit (SDK) documentation, to your hard disk drive.

  • To build the sample from the build environment command window, go to the source directory of the sample. At the command prompt, type MSBUILD.

  • To build the sample in Microsoft Visual Studio, load the sample solution or project file and then press CTRL+SHIFT+B.

Running the Sample

  • To run the compiled sample from the build environment command window, execute the .exe file in the Bin\Debug or Bin\Release folder contained under the sample source code folder.

  • To run the compiled sample with debugging in Visual Studio, press F5.


The Graphing Calculator demonstrates some of the advanced 2-D and 3-D Windows Presentation Foundation (WPF) drawing capabilities.

This sample has some viewing features that are not immediately obvious.

In 2-D Graphs:

  • To zoom in, left-click the mouse and drag a rectangle over the area you want to enlarge. The viewport will automatically resize to the size of the rectangle drawn. If you do not want to zoom in after a left-click has been processed, right-clicking the mouse will make the rectangle disappear.

  • To zoom out, right-click the mouse. The viewport will zoom out by a factor of 2 from the center of the screen.

In 3-D Graphs:  

  • To rotate the mesh, left-click the mouse and drag the cursor around.

  • To zoom in and out, press and hold the right mouse button, then press and hold the left mouse button. While the two buttons are held, move the mouse up or down.

  • To reset the camera to its default position, double-click on the screen.

Input nuances:

  • The sin, cos and tan operations all require input that is surrounded by parentheses. Therefore, "sin34" won't work, but "sin(34)" will.

  • "x^y" means x to the yth power. It is not an XOR operation.

  • Shorthand constructs such as 2x and 7sin(3) are allowed, for convenience. To get the same effect with variables and functions, a simple space works the same way. For example, "u v" will be interpreted as u*v, but "uv" will be interpreted as a single variable, "uv".

  • Variables are not case-sensitive.

  • Pi can be accessed by using the variable "pi".

  • In nongraphing mode, the calculator saves the last valid answer in a variable called "ans".