5,661,954 members and growing! (15,205 online)
Email Password   helpLost your password?
Desktop Development » Miscellaneous » Custom Controls     Beginner License: The Code Project Open License (CPOL)

WPF Expression Blend 2 tutorial: WPF Manufacturing Gauge Fan Custom Control

By Steve-Low-NextwaveSoft

Step by step WPF Expression Blend2 tutorial on how to draw and animate a WPF Fan Control in Manufacturing Gauge using Expression Blend 2. Only XAML code is used, so all effects are done in markup.
C#, Windows, XAML, Design, Dev

Posted: 15 Jul 2008
Updated: 15 Jul 2008
Views: 7,055
Bookmarked: 14 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
8 votes for this Article.
Popularity: 3.31 Rating: 3.67 out of 5
0 votes, 0.0%
1
0 votes, 0.0%
2
2 votes, 25.0%
3
4 votes, 50.0%
4
2 votes, 25.0%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article

Introduction

In this tutorial, I'm going to explain how to draw and animate WPF Fan control that can be used in Manufacturing Simulation, using Blend 2. It is only XAML code. By the end of this tutorial, you'll know:

  • how to draw basic element using Blend 2
  • how to animate

Background

Get some basic knowledge of Blend 2 from:

.NET 3.0 WPF Tools && Examples

Using the code

Step1: When you create a new application project in Blend2, you should see the Window and Layout Root Grid in the Objects and Timeline. Add Grid and Canvas as showed below.

FanTutorial1.jpg

Step 2: Draw the Stand of the Fan using Rectangle Element in Blend2. There are two Horizontal Rectangle and one Vertical Rectangle.

FanTutorial2.jpg

Step 3: Draw the Cap and Wings of the the Fan using Eclipse Element in Blend2. You can show Transform and Rotate to duplicate the wings drawings.

FanTutorial3.jpg

Step 4: After finish the Fan drawing, you can add a new Storyboard by click the "+".

Enter the Name of the Storyboard.

FanTutorial4.jpg

Step 5:From the storyboard, click on the "+" to enable recording.

You shall notice "Timeline recording is on" showed

FanTutorial5.jpg

Step 6: Draw the timeline from 0:00.000 to 0:00.100.

FanTutorial6.jpg

Step 7: Select the FanCanvas from Objects and Timeline and make sure it is on focus.

From the Designer windows, looks for the rotate icon at the edge of the canvas.

Rotate the canvas 360 degree. You shall notice Render Transform->Rotation->Angle are added.

FanTutorial7.jpg

Step 8: Right-click on the Angle Timeline and you shall notice the "Edit Repeat Count"

FanTutorial8.jpg

Step 9: Click on the infinity icon from the window to make sure it rotates forever

FanTutorial9.jpg

Step 10: Add basic Triggers interaction by Adding +Event->Window.Loaded->TurningFan.Begin

FanTutorial10.jpg

Step 11: Press F5 and your first WPF Fan is completed.

View more WPF Controls from nextwavesoft

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Steve-Low-NextwaveSoft


Senior Software Developer at nextwavesoft
Occupation: Software Developer (Senior)
Company: www.nextwavesoft.com
Location: Asia/Pacific Region Asia/Pacific Region

Other popular Miscellaneous articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
  (Refresh) 
-- There are no messages in this forum --

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 15 Jul 2008
Editor:
Copyright 2008 by Steve-Low-NextwaveSoft
Everything else Copyright © CodeProject, 1999-2008
Web15 | Advertise on the Code Project