I found this tutorial to get a running start with using the Lego Mindstorm sensors that I recommend checking out here: http://msdn.microsoft.com/en-us/library/ff631059.aspx.

Each sensor can be dropped and dragged on to the diagram contains an input for incoming request, outgoing request, and notification. Notification gives you options such as if statements, switch, calculations and more. You simple just drag an output connection to an input connection to an output connection.  

If you choose “ShowInBrowser” when you are setting up the brick you get several options to view what your sensors are doing and responding to when you run your program in your browser.

Clicking on a sensor, gives you a URL to see more about the sensor.

As you can see, you can watch the action of the sensor. Here I am pressing the sensor and the studio displays this.