:: Home

  login:         
  passwords:  

WPF FAQs

WPF General Questions
Concepts Element Tree
Concepts Dependency Property
Concepts Attached Property
Concepts Routed Events
Concepts Resources.
Concepts Animation
Concepts Freezable Object
Concepts Input and Commands.
Concepts Layouts
XAML Inline Styles and Templates
XAML XML Namespaces
XAML Code Behind
XAML Custom Class
XAML Type Converters
Content Model ItemControl
Content Model HeaderedItemsControl
Content Model HeaderedContentControl
Content Model Content Control
Content Model Decorator Content Model
Content Model Panel Content Model
Documents Serialization and Storage
Documents Annotations
Documents Flow Content
Documents Printing
Graphics and Multimedia Rendering Graphics
Graphics and Multimedia Animation and Timing
Graphics and Multimedia 2D Graphics
Graphics and Multimedia 3D Graphics
Graphics and Multimedia Visual Layer
Control Customization Adorners
Control Customization Stylable controls
Control Customization ControlTemplates
Data Data Binding
Data DragandDrop
Data Serialization
Globalization and Localization Attributes
Globalization and Localization Comments
Globalization and Localization Globalization Struc
Application and Deployment ClickOnce
Application and Deployment Frame
Application and Deployment Page
Application and Deployment Navigation
Application and Deployment Setup
Application and Deployment Window
Interoperability Message Loops Between
Interoperability Win32 in WPF
Interoperability WPF in Win32
Interoperability Windows Forms and WPF
Security Trusted Security
Security Partial Trust Security
Tools Microsoft Expression Blend
Tools ZAM3D
Tools XAMLPAD
Controls ToolTip
Controls TextBlock
Controls TabControl
Controls ProgressBar
Controls PrintDialog
Controls Popup
Controls TextBox
Controls Canvas
Controls ComboBox
Controls ListBox
Controls StatusBar
Controls ToolBar
Controls Context Menu
Controls Expander
Controls DocumentViewer
Controls FlowDocumentReader
Controls GroupBox
Controls GridSplitter
Controls Image
Controls Menu
Controls ScrollBar
Controls Slider
Controls RichTextBox
Controls Border
Controls Buttons

SilverLight Interview Qs

SAP Interview Questions

Oracle Interview Questions

PHP Interview Questions

Ajax Interview Questions

IIS 7.0

OOP Interview Questions

Ruby Interview Questions

Sql Server Interview Questions

Winforms Interview Questions

SharePoint 2007 Questions

Microsoft Crm Questions

Concepts Animation Interview Questions & FAQs

Questions and answers for Concepts Animation.
 

7. Concepts Animation

    7.1 What are the requirements for a property to be animated?
    7.2 How do I trigger an animation when the data in the control is changed?
    7.3 What is Path animation?

7.1How do I trigger an animation when the data in the control is changed?

WPF enables users to apply animations to objects by applying animations on properties. For a property to have animation capabilities, it should have the following requirements.

  • The property should be a dependency property.
  • It must belong to class that inherits from the DependencyObject class and implements the IAnimatable interface.
  • There must be a compatible Animation type available for the property. For e.g. the Double type property can be animated using the DoubleAnimation. Similarly, the property to be animated should contain the corresponding animation type.

7.2How do I trigger an animation when the data in the control is changed?

Animations can be applied to the objects in WPF application when the data in the control changes using the DataTriggers. The following lines of code is used to apply animations using a DataTrigger

[XAML]

<TextBlock Text="WPF Application" Name="tb1" Foreground="Blue" FontSize="28" TextAlignment="Center" Height="50" VerticalAlignment="Top">

<TextBlock.Style>

     <Style>

<Style.Triggers>

<DataTrigger Binding="{Binding ElementName=cb1,Path=IsChecked}" Value="true">

<DataTrigger.EnterActions>

<BeginStoryboard>

<Storyboard>

<DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:1" AutoReverse="True" RepeatBehavior="Forever" />

</Storyboard>

</BeginStoryboard>

</DataTrigger.EnterActions>

<DataTrigger.ExitActions>

<BeginStoryboard>

<Storyboard FillBehavior="Stop">

<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:1" />

</Storyboard>

</BeginStoryboard>

</DataTrigger.ExitActions>

</DataTrigger>

</Style.Triggers>

</Style>

</TextBlock.Style>

</TextBlock>

<CheckBox Name="cb1" Content="Show Animation" IsChecked="True" Height="30" HorizontalAlignment="Center" />

 

7.3 What is Path animation?


Path animation is a type of Animation Timeline that uses a Path Geometry for animation instead of properties like From, To, By or ByUsingKeyframes. In a Path animation, the object moves along the path specified by the Path geometry. As the animation progresses, it reads the X-axis, Y-axis and angle information from the path geometry and generates the output. Path animations are useful when an object has to be animated along a complex path.

bottom user control
::  Home :: Services ::  Prices ::  Request Quote
Copyright 2007, Megasolutions Ltd