Sunday, February 17, 2008

WPF for Dummies :)

Hello everyone..

Here I am giving a very basic XAML demo, especially for those lovely developers who have not yet code a single line in XAML, and who are just aware of XAML..well..its pretty simple..If you are using Visual Studio.NET 2005, you need to Download SDK for it, If you are using Orcas/VS2008 Beta2/VS RTM..then Life is easy for you as all the stuff is built-in.

You need to choose WPF application from File-> New -> Project

This will throw you in IDE and then you need to just play in XAML tab just next to Design.


<Button x:Name="Vikram"
Height="50" Width="200" Content="Click">




This will allow you to put simple button on. On similar lines you can add Textbox also, so for adding textbox,you need to write following code.


<TextBox x:Name="Mytxt" Height="50" Margin="39,35,39,0" VerticalAlignment="Top"></TextBox>


So, lets do some more fun with this..lets rotate both in 45 you will now have to write down the Transform for this..This is how we do it.



<Button x:Name="Vikram" Content="Click" Height="50" Width="200"


<RotateTransform Angle="45">




<TextBox x:Name="Mytxt" Height="50" Margin="39,35,39,0" VerticalAlignment="Top">


<RotateTransform Angle="45">




</Grid> it is..First WPF application with XAML is ready to run!! will njoy those small codes..will come up with more soon..



No comments: