Your first WPF Drawing Application

In this lab, you will build a WPF application that allows you to draw geometries.

1. Start Microsoft Visual Studio 2008 from Start | All Programs | Microsoft Visual Studio 2008.

2. Create a new WPF project. In Visual Studio select File | New | Project. In the New Project Dialog select Visual C# | Windows in the tree view on the left, and select WPF Application (make sure that .NET Framework 3.5 is selected in the drop-down list at the top right of the dialog box).

clip_image002

3. In the XAML editor, change the Title property of the Window element to WPF Viewer.

4. Add an Ink Canvas to the Window and name it DrawingPad. To do this, add the following code (shown in bold) into the Grid element.

<Grid >

<Border BorderBrush=”Gray” BorderThickness=”1″ >

<InkCanvas Name=”DrawingPad” />

</Border>

</Grid>

5. Add an event handler for the StrokeCollected event by writing code in the XAML editor (this should generate the event handler method as well). At this point, your XAML code should look like this.

XAML

<Window x:Class=” WPFViewer.Window1″

xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation”

xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml”

Title=”WPF  Viewer” Height=”300″ Width=”300″>

<Grid >

<Border BorderBrush=”Gray” BorderThickness=”1″ >

<InkCanvas Name=”DrawingPad” StrokeCollected=”DrawingPad_StrokeCollected” />

</Border>

</Grid>

</Window>

clip_image004

6. Press F5 to run the application and draw some shapes on the Ink Canvas.

clip_image006

7. Close the application.

VS2010:- Functional and Parallel computing through F#

F# is a succinct, expressive and efficient functional and object-oriented language for .NET which helps you write simple code to solve complex problems. It’s is a new functional programming language from Microsoft while it is primarily a functional programming language, it is known as a multi-paradigm language because it also supports object-oriented programming. F#’s tight integration with the entire .NET system of libraries and development environment enables developers to bring the power of Functional Programming to the .NET platform.

It is a simple and pragmatic language, and has particular strengths in data-oriented programming, parallel I/O programming, parallel CPU programming, scripting and algorithmic development.

This language is now treated as a first class language in Visual Studio 2010, and can also be used on Mac, Linux and other platforms. F# originates from Microsoft Research, Cambridge, and the MSR F# team, led by Don Syme, continues as partners with the Microsoft Developer Divsion.

Download now! http://research.microsoft.com/en-us/um/cambridge/projects/fsharp/

T-SQL New Features in Visual Studio 2010

Microsoft Visual Studio 2010 brings a lot of new features that combine a first-class Transact-SQL IDE with a new project template to produce a comprehensive model of the objects, policies and runtime resources required by a data-tier application. The improvements in the Transact-SQL Editor experience let you use the same tools available to application developers when writing your T-SQL code:
Online and Offline IntelliSense: The Transact-SQL Editor suggests values while you type your T-SQL code. Depending if you are connected or not to a database instance, it fetches in the already defined objects of the project system or asks to the connected instance for IntelliSense information.
Debugging: Debug your stored procedures, functions and scripts from the Transact-SQL Editor using the standard debugging tools (Call Stacks, Locals, Watch, etc).
Refactoring: Rename an object and have all the uses of that object name changed throughout your database design. Visual Studio 2010 will display all the places that will be impacted by the change and you can then apply the changes once you are satisfied.
Unit testing: Implement unit tests written in T-SQL to verify your stored procedures and functions.
Static Code Analysis: Run Code Analysis Rules to identify potential bugs in your T-SQL code.
Source Code Control integration: For example, use the Shelf Set functionality in Team Foundation Server to collaborate with the rest of your team before attempting to deploy the changes to a production environment.
Automate Build and Deployment to an integration test environment: For example, use the Build Agent of the Team Foundation Server to automatically build and deploy database schema changes as well as any changes to the other tiers of your N-tier application. Then automatically run unit tests for each tier to identify any potential issues.

VB.NET Check Windows7 MultiTouch Capability on a Device

This code will check the Multitouch capability of a Hardware for Windows7 Modern Applications

To execute this code you either need to have VS 2008 SP1 with .NET 3.5 or VS 2010 with .NET 4.0
References to the following libraries are to be made:
Windows7.Multitouch.dll
Windows7.Multitouch.WPF.dll.

If Not Windows7.Multitouch.TouchHandler.DigitizerCapabilities.IsMultiTouchReady Then
MsgBox(“Multitouch is not availible”)
Environment.Exit(1)
End If

Creating Temporary Projects in Visual Studio 2008

How many times it happened to you that you are working on a project and in the middle of the coding you want to experiment with one of the features of any programming language in VS so that it can be applied in the project? You realize that you need to open a new project, experiment it there / or show off in front of your colleagues with your latest discovery and then bye bye to that new project.

Wouldn’t that be a good idea if such projects do not get saved?

This behavior is supported in Visual studio 2008.

Go to Tools – > Options -> Projects and Solutions – > General, and disable the “save new projects when created option”

Screen shot below

Creating temporary projects in VS 2008