Can I host WPF objects in WIN32 application ?

Yes. VisualObjects of WPF application can be hosted in WIN32 application using the “HwndSource” class. The HwndSource class wraps the objects in the WPF application and allow them to be incorporated in the WIN32 application as a child window.

How HitTest methods in VisualTreeHelper is useful ?

HitTest methods are used to determine whether a point or geometry value is within the content of a rendered object like a control or graphic element. Using the ’HitTest’ methods you can determine whether the mouse was clicked within a control and also by overriding the implementation, custom actions can be performed.

How do I apply Transform when an event is occurred ?

Any type of transform can be applied when an event has occurred. The following lines of code apply a ’RotateTransform’ when the mouse is moved over the image. [XAML] <Image Source='pda.ico' MouseEnter='Image_MouseEnter' MouseLeave='Image_MouseLeave'> <Image.RenderTransform> <RotateTransform Angle='0' x:Name='ImageRot'/> </Image.RenderTransform> </Image> [C#] private void Image_MouseEnter(object sender, MouseEventArgs e) { ImageRot.Angle = 30; } private void Image_MouseLeave(object sender, MouseEventArgs e) { ImageRot.Angle = 0; }

How do I apply an animation without using a storyboard ?

Animations can be applied without using the StoryBoard. BeginAnimation() method can be used to apply animations instead of StoryBoard. This method can be used when simple animations are applied to a property of a control. The following code snippet animates the width of the TextBlock using the ’BeginAnimation’ method. [C#] DoubleAnimation Dblanimation = new DoubleAnimation(); Dblanimation.From = 25; Dblanimation.To = 50; Dblanimation.Duration = new Duration(TimeSpan.FromSeconds(3)); tb.BeginAnimation(TextBlock.WidthProperty, Dblanimation);

How rendering in WPF differs from WIN32 applications?

A WIN32 application uses immediate mode graphics system wherein the application is responsible for repainting the client area when they are resized or the object’s visual appearance is changed. WPF on the contrary uses retained mode graphics system. In this mode, drawing information of an object is persisted and serialized by the application and the rendering is done by the system.