Saturday, December 25, 2010

How to create Animation in Silverlight

Sample Animation with Silverlight
Silverlight is the one the latest technologies being used in the web application. It is an web plug-in with cross browser ability, makes it penetration in to the market very high. Using Silverlight, we can create a rich UI (not only) web application with Audio, Video enabled, Vector graphical images (crystal clear), and lot more…….
One of the features is Animation. Animation is an illusion by quickly cycling through a series of images, each slightly different from previous one , which makes appearance of continuous movement.
Microsoft Expression blend is a visual tool for designing web applications. It also helps us to create the animation. I will demonstrate how to create an sample animation step by step. Here animations are based on the Keyframes.
Open the Microsoft Expression Blend (I used Blend 4).
1. Go to the file and select ‘New Project’ menu. The available template list will be displayed. Select the Silverlight Application + Website. And enter the project name and change the Location (if you wish) and click ok.

2. In the Left more corner (at the bottom), you can find a tab called ‘Asset’, which lists all the controls available for our web development. Click on it and select the ‘Control’ (or search ‘control’) and location the ‘Text Box’ control and drag it in to the main page Designer (the area appears in white).

3. You can change the properties of the controls and font by using the Properties tab.

4. Select the ‘Textbox’ object and go to the Object menu and select the path option and click ‘Convert to path’. It makes the text objects converted to a continuous path

5. Find the ‘Objects and Timeline’ tab, and right click (or click +) to create a new story board, it is an container in which the key frames are defined.

6. Select the ‘Direct Selection top’ and select the Text box object, The points of your path object are identified on the artboard by small squares

7. Click on the ‘Record Keyframes’ (0+) , creates an key frame (0) appears on the timeline.

8. Move the ‘timeline playhead’ to the time (location) where you want the animation to by end. Do the movement in the textbox object (in this case, i increased the size of the text box object). A another keyframe symbol will appear on the timeline.

9. Now again click ‘Record Keyframe’ (0+) button, which stops the recording. Now your animation is created. Click the ‘Play’ button to text your animation.

10. By default the animation what we created now is appears or plays only once. To keep it running, Select the storyboard, and go to the properties tab, in the ‘Common Properties’, Select ‘Forever’ option for Repeat Behaviour.
IF you want to do the auto reversing, check the ‘AutoReverse’ check box.

11. As of now we just created an animation control, now we need to make it run during an event. We can write it in the code behind to begin the animation or we can user the behaviour control.
12. Go to the Asset tab and find the ‘Controlstoryboardaction’ control under the behaviour category.

13. Drag it and place it under the ‘Layout Root’ and rename it as you required

13. Click on the properties tab and set the following behaviour.
a. EventName : Loaded
b. ControlStoryboardOption:Play
c. Storyboard:
Your storyboard

14. Build your project and run it. Your animation project is ready to deploy.

Wednesday, December 1, 2010

Parallel Computing - .NET 4.0 Framework

Parallel Computing

Parallel Computing is a one of the new feature included in .NET framework 4.0. It is an multitheading programming model which executes asynchronously to increase the performance of the application

The following technologies are available in .NET 4.0 with parallel computing implementation

a. Task Parallel Library
b. Parallel LINQ
c. Data Strutures for parallel Programming
d. Parallel Diagnostic Tool
e. Custom partitioners for PLINQ and TPL
f. Task Factories
g. Task Schedulers
h. Lambda Expression in PLINQ and TPL

We will see details about each technology in forthcoming articles.

Microsoft Webcamp - 1 Dec 2010, Chennai

Microsoft Webcamp:

I have attended the Microsoft webcamp on 1st Dec 2010 in chennai. The topics covered were listed here.

Microsoft Web Platform: A Complete Picture
ASP.NET Web Forms/MVC: Building Robust Web Applications and Catering to Diverse Needs
Rich Internet Applications powered by Silverlight 4
WebMatrix: Building Razor based Web Applications.
Web App Gallery: Getting Your Applications up and running very quickly.

It was a full day session. It was an very interactive sessions and it went well. The topics covered is useful for the webdeveloper who actually wants to learn new things in