All sections to appear here

27
All sections to appear here Mahesh Krishnan | Principal Consultant | [email protected] | blogesh.wordpress.com

description

All sections to appear here. Mahesh Krishnan | Principal Consultant | [email protected] | blogesh.wordpress.com. What is Expression Blend?. Primary Tool for Designing User Interfaces Visually design UI – Blend creates XAML - PowerPoint PPT Presentation

Transcript of All sections to appear here

Page 1: All sections to appear here

All sections to appear here

Mahesh Krishnan | Principal Consultant | [email protected] | blogesh.wordpress.com

Page 2: All sections to appear here

What is Expression Blend?

• Primary Tool for Designing User Interfaces• Visually design UI – Blend creates XAML• Better user experience than Visual Studio when working UI

design• You still need VS 2010 to do all the developer stuff

Page 3: All sections to appear here

Blend vs Visual Studio

• When would you use Expression Blend?– Prototyping UI– User Interface design– Writing small blocks of code– Importing designs from Photoshop and Illustrator– Animation

• When would you use Visual Studio?– Simple UI design– Writing code– Debugging, setting breakpoints, etc– Integrating with other projects (.NET WCF Services, WCF, ...)

Page 4: All sections to appear here

Tour of Expression Blend

• Menus• Tools Panel• Assets Panel• The Artboard

– Different views• Properties Panel• Objects and Timelines Panel• ...

Page 5: All sections to appear here

Demo - Hello World

Discover, Master, Influence Slide 9

Page 6: All sections to appear here

Demo – Brushes

Discover, Master, Influence Slide 10

Page 7: All sections to appear here

Demo - Transformations

Discover, Master, Influence Slide 11

Page 8: All sections to appear here

Demo - Layouts

Discover, Master, Influence Slide 12

Page 9: All sections to appear here

Styling

• Allows re-use of look and feel across controls:– Color, Font, Margins, etc

• Created as a resource:<Application.Resources> <Style x:Key="Style1" TargetType="TextBlock"> <Setter Property="Foreground" Value="#FFF0D3D3"/> <Setter Property="FontSize" Value="36"/> </Style></Application.Resources>

Page 10: All sections to appear here

Applying a Style

• Set using Style property using the StaticResource mark-up in XAML:

<TextBlock Text="Hello World" Style="{StaticResource Style1}" />

Page 11: All sections to appear here

Demo – Styling a Button

Discover, Master, Influence Slide 16

Page 12: All sections to appear here

Skinning or Templating

• Allows you to change the complete appearance of the control

• Like Style, created as a resource:

< Application.Resources> <ControlTemplate x:Key="MyTemplate" TargetType="Button"> <Grid> ... <Rectangle .../> <ContentPresenter ... Content="{TemplateBinding Content}" /> </Grid> </ControlTemplate>< /Application.Resources>

Page 13: All sections to appear here

Applying the template

• Set using Template property in XAML:

<Button Content=“Click Me!" Template="{StaticResource MyTemplate}" />

Page 14: All sections to appear here

Managing States

• Uses Visual State Manager– Allows setting different State groups for a

control• Manages transition between states– Controls the look and feel of the control when

state transition occurs• Allows designers to define state transition

behaviour (usually done using Animation)

Page 15: All sections to appear here

Demo – Skinning a Button

Discover, Master, Influence Slide 21

Page 16: All sections to appear here

The Parts Model

Page 17: All sections to appear here

Demo – Templating Slider

Discover, Master, Influence Slide 23

Page 18: All sections to appear here

Introduction

• Animation is created by quickly cycling through a series of images

• Each image is slightly different from the previous one

• Image is created by changing a (visual) property• Basic animations works on properties of type:– Double– Color– Point

Page 19: All sections to appear here

Basic Animation

• Storyboard– Container for animation–Manages timeline. Can start, pause, stop

animations• xxxxAnimation (e.g. DoubleAnimation)– Specify From, To and Duration– Storyboard will do the interpolation

Page 20: All sections to appear here

Basic Animation in XAML

• XAML Syntax for Storyboard:

<Storyboard x:Name="MyStoryboard"> <DoubleAnimation Storyboard.TargetName="rect1" Storyboard.TargetProperty="Width" From="40" To="100" Duration="0:0:5"> </DoubleAnimation></Storyboard>

Page 21: All sections to appear here

Key Frame Animation

• Animates between a series of values• XAML Syntax for Storyboard:

<Storyboard x:Name="MyStoryboard"> <DoubleAnimationUsingKeyFrames Duration="0:0:4.5" Storyboard.TargetName="rect1" Storyboard.TargetProperty="Width”> <LinearDoubleKeyFrame Value="140" KeyTime="0:0:0"/> <LinearDoubleKeyFrame Value="10" KeyTime="0:0:2.2"/> <LinearDoubleKeyFrame Value="140" KeyTime="0:0:3"/> </DoubleAnimationUsingKeyFrames></Storyboard>

Page 22: All sections to appear here

Demo – Animation

Discover, Master, Influence Slide 29

Page 23: All sections to appear here

Data Binding

• Data binding is a connection between User Interface object and data

• Aids in the separation of responsibility• You can also data bind value of one

control to another

Page 24: All sections to appear here

Demo – Data binding

Discover, Master, Influence Slide 32

Page 25: All sections to appear here

Data Binding XAML

• Every (Dependency) Property in a control can be databound• In XAML, the following syntax is used:

• In code, the DataContext property of the TextBlock is set to the actual object

<TextBox x:Name=“txtISBN" Text=“{Binding ISBN, Mode=TwoWay}“ />

Page 26: All sections to appear here

Demo – Sample data

Page 27: All sections to appear here

Want to find out more?