Add Animations In WPF Apps With Blend 2015

Microsoft Blend is a perfect tool to design your WPF apps. Now the WPF App Designing is easier than ever before. And it is all due to the great features of Blend 2015. The Blend 2015 has similar look with Visual Studio 2015 and feel of more support for designers. Whatever you do with your project by staying at any of the platform, the changes will automatically synchronous across the project among these two tools. Like Visual Studio, you can also create project in Blend and start working upon it like Visual Studio and you feel exactly the home environment which you feel with Visual Studio. Perhaps the main focus of Microsoft Blend is towards designing, so you will have more designer lover environment over here.

With the great support of Blend 2015 you can play with Animations in your WPF App. You can design any type of Application through Blend 2015. Now if you want to create a Pendulum Oscillation with Animations in Blend 2015 then through the following easy steps you can do it easily.

Simply create an Empty WPF Project in Microsoft Blend for Visual Studio:

Image

Microsoft Blend will start the project and open a great designer environment for you,

Image

To create some UI, you need some hands-on with Blend features.

Let’s start one by one.

Image

On the left top side of Blend, you can see the Solution Explorer, Assets, States and Data. This section is related to your Project. Perhaps it is also designed in such a way that will help you in the design of your app.

Image

At the left bottom, you can see the section of Objects and Timeline that help you to animate your design.

  1. Objects view:You can drill down to varying levels of detail. You can also add layers to further organize objects on the artboard. That way you can lock and hide them as a group.
  2. Record mode indicator: That tell you whether you’re recording property changes in a timeline.
  3. Storyboard picker:View a list of storyboards that you’ve created.
  4. Close storyboard:Close the current storyboard.
  5. Storyboard options:Create, duplicate, reverse, delete, rename, or close a storyboard.
  6. Playback controls: ItNavigate through the timeline. You can also drag the playhead to navigate through (orscrub) the timeline.
  7. Return scope to:Scope the objects view back to the previous root object or previous scope. You can do this only when you’re modifying a style or template.
  8. Record akeyframe:Record a snapshot of the properties of the selected object at the current point in time.
  9. Snapping options:Set timeline snapping, snap resolution, and turn off timeline snapping.
  10. Show/hide,Lock/unlock:Show or hide the visibility and locking options for the objects view.
  11. Playheadposition on the timeline:Show the current time in milliseconds. You can also enter a time value directly in this field to jump to a particular point in time. The precision depends on the snap resolution set in theSnapping Options.
  12. Playhead:Determine what point in time the animation is at. You can drag theplayheadacross the timeline to preview animation.
  13. Keyframesset on timelines:Change a property value at a specific point in time.
  14. Change order of objects:Set the display order of objects. Click this button to arrange objects in the structure view by Z order (front-to-back) or by markup order (the order in which they appear inXAMLview).
  15. Timeline zoom:Set the zoom resolution of the timeline. Zooming in lets you edit an animation with more detail, and zooming out shows more of an overview of what is happening over longer periods of time. If you zoom in but can't set a keyframe at the position in time that you want, verify that the snap resolution is set high enough.
  16. Timeline composition area:View the timeline, and movekeyframesaround by dragging them or using their shortcut menus.

On the right side of the blend, there’s the property windows that will help you to customize your stuff,

Image

  1. Name and Type View the icon, name and type of the selected object.
  2. Arrange by Arrange properties alphabetically by name, source, or category.
  3. Brush properties Set the visual properties for brushes such as Fill brush, Stroke brush, and Foreground brush.
  4. Color editor Use for solid color and gradient brushes.
  5. Color picker Select a color.
  6. Color chips View the initial color, current color, and last color.
  7. Eyedroppers Use the color of any element on your screen. The Color eyedropper is available when the Solid color brush is selected. The Gradient eyedropper is available when the Gradient brush is selected.
  8. Properties and Events Set properties or choose events for a selected element.
  9. Search box Search for properties. Filter the properties that are displayed by typing in the Search box.
  10. Brush editor tabs Use to select a brush editor. You can choose No brush, Solid Color brush, Gradient brush, Tile brush, or Brush resource.
  11. Color resources Apply the exact same color to different properties. The Color Resources tab includes Local Resources and System Resources.
  12. RGB color space Modify the color by adjusting the values for the R, G, or B (red, green, blue) number editors.
  13. Alpha channel Modify the Alpha value by using the number editor next to A.
  14. Convert color to resource Convert the selected color to a color resource. Color resources are available when you click the Color resources tab.
  15. Hex value View the hexadecimal value of the color displayed.
  16. Gradient slider Appears only if a gradient brush is selected.
  17. Show advanced properties View categories of properties that are less commonly used.

The Asset window help you to manage your assets easily and utilize them according to need,

Image

  1. Search box Type in the Search box to filter the list of assets. 
  2. Grid mode and List modeSwitch between the Grid mode view and the List mode view of assets.
  3. Assets categories Click a category or subcategory to view the list of assets in that category.
  4. StylesShow all the styles that are contained in the resource dictionary.
  5. DescriptionView a description of the selected assets category or subcategory.

The Tools Panel of the Blend is really cool and helps you to directly design your app by using helpful tools from the tools panel.

Image

Selection tools: Select objects and paths

  1. Use the Direct Selection tool to select nested objects and path segments.
  2. View tools: Adjust the view of the artboard, such as for panning and zooming.
  3. Brush tools:Work with the visual attributes of an object, such as transforming a brush, painting an object, or selecting the attributes of one object to apply them to another object.
  4. Object tools: Draw the most common objects on the artboard, such as paths, shapes, layout panels, text, and controls. 
  5. Asset tools: Access the Assets panel to show the most recently used asset from the library.

Now simply draw one Eclipse and two Rectangles in such a way that it shows the Pendulum Model. Add Gradients and adjust the colors,

Image

And move the Unit Operation to combine both the shapes and move the central point of the shape object to top, so the Shape can rotate according to top access.

Now simply go to ‘Object and Time’ windows and add new Storyboard from Story Board Options.

Image

Simply take the timeline to 1 Second.

Image

And Move the Pendulum Object according to need.

Image

And again go to TimeLine and increase the timeline and move the object in similar manner,

Image

Now Click upon the StoryBoard Name and in Properties Windows.

Image

Now simply go to Assets Windows and in Behaviors select the ‘ControlStoryboardAction’ and drop into the Design surface.

Image

And in the Properties Window, select the name of Storyboard in the Storyboard option,

Image

Now when you run the project, you’ll see that the Oscillation of Pendulum will perform continuous oscillate,

Image

So, you saw how the magic happened in Blend by just few clicks. Design changes very smartly in your WPF Apps and make your life easy