Book Image

Blend for Visual Studio 2012 by Example: Beginner's Guide

By : Abhishek Shukla
Book Image

Blend for Visual Studio 2012 by Example: Beginner's Guide

By: Abhishek Shukla

Overview of this book

<p>Creating applications with compelling graphics has been one of the main goals of client applications, and with the arrival of WPF, Silverlight, and HTML5 it is much easier than ever before to create interactive and rich user interfaces.</p> <p>Blend for Visual Studio 2012 by Example Beginner's Guide will give you a good grounding in creating Windows, Web, and Windows Phone applications. You will also look at the various layouts and controls available in Blend and how we can create animations and behaviors in Blend.</p> <p>Towards the end, you will be aware of the various capabilities that are available in Blend out of the box.</p>
Table of Contents (19 chapters)
Blend for Visual Studio 2012 by Example Beginner's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Time for action – adding elements in XAML by hand-coding


In this section, instead of dragging and dropping controls, we will add XAML code:

  1. Move MainWindow.xaml to XAML and add the code shown here to add TextBlock and three buttons in Grid:

    <Grid x:Name="LayoutRoot">
    <TextBlock Text="00:00" Height="170" Margin="49,32,38,116" Width="429" FontSize="48"/>
        <Button Content="Start" Height="50" Margin="49,220,342,49" Width="125"/>
        <Button Content="Stop" Height="50" Margin="203,220,188,49" Width="125"/>
        <Button Content="Reset" Height="50" Margin="353,220,38,49" 
        Width="125"/>
    </Grid>
  2. We set a few properties for each of the elements. The property types of the various properties are also mentioned. These are the .NET types to which the type converter would convert them:

    • Content: This is the content displayed onscreen. This property is of the Object type.

    • Height: This is the height of the button. This property is of the Double type.

    • Width: This is the...