Thursday, January 16, 2014

ProgressBar Example 2 in WPF

Sometimes expressing the progressing of progress bar in a fraction is not appropriate or efficient since we don’t know how long it will take. 
In this case, the indeterminate progress bar can be used efficiently, where an animation lets the user know that something is happening, while indicating that the running time can't be determined.
For this, we have to set the property IsIndeterminate of control ProgressBar to true.

ProgressBarExample2.xaml
UI Display:

Progressbar Example1 in WPF

ProgressBarExample1.xaml






UI Display:











After Pressing F5,We can see the progress of bar.











Notes:
The RepeatBehavior property of a Timeline controls states about how many times an animation repeats its simple duration. By using RepeatBehavior, we can specify a Timeline repeats for a certain number of times (an iteration count) or for a specified time period.
By default, timelines have a repeat count of 1.0, which means they play one time and do not repeat.If  we  set the RepeatBehaviorproperty of a Timeline to Forever, the timeline repeats indefinitely.

Tuesday, January 14, 2014

Ease Functions in WPF

EasingFunctionBase
It provides the base class for all the easing functions

Easing functions 
It provide a way to customize mathematical formulas to animations.
There are certain real time examples on which animation effects take a significant amount of work and even less accurate.So by using mathematical formula or mathematical stuff ,animation effects can be accurate and can be sharpened
We have one of several easing functions provided by the runtime to create common effects.
  • BackEase : Retracts the motion of an animation slightly before it begins to animate in the path indicated.
  • BounceEase : Creates a bouncing effect.
  • CircleEase : Creates an animation that accelerates and/or decelerates using a circular function.
  • CubicEase : Creates an animation that accelerates and/or decelerates using the formula f(t) = t3.
  • ElasticEase : Creates an animation that resembles a spring oscillating back and forth until it comes to rest.
  • ExponentialEase : Creates an animation that accelerates and/or decelerates using an exponential formula.
  • PowerEase : Creates an animation that accelerates and/or decelerates using the formula f(t) = tp where p is equal to the Power property.
  • QuadraticEase : Creates an animation that accelerates and/or decelerates using the formula f(t) = t2.
  • QuarticEase : Creates an animation that accelerates and/or decelerates using the formula f(t) = t4.
  • QuinticEase : Create an animation that accelerates and/or decelerates using the formula f(t) = t5.
  • SineEase : Creates an animation that accelerates and/or decelerates using a sine formula.

Saturday, January 11, 2014

Navigation in WPF

WPF supports two types of Navigation such as  for standalone application and for XAML browser application. It provides Page class to support Navigation.
Here we will discuss about standalone Application only
NavigationExample1.xaml



Page1.xaml




Page2.xaml






UI Display:
After pressing F5,











Here we see that there are three links which navigate to respective page.
On clicking on Home link,











On clicking on About link












On clicking on My Site link

ListBox Example 1

Here we will see the loading of items in ListBox asynchronously.
ListBoxExample1.xaml








ListBoxExample1.xaml.cs













UI Display:
After pressing F5,










Here we can see two processes at a time(asynchronously) in the above figure
1. Increment of number by 1 in the grid.
2. Display of a MessageBox along with number population in grid.

Application Command Example3

Here,we will see the use of command Help
ApplicationCommandExample3.xaml




ApplicationCommandExample3.xaml.cs










UI Display:
After pressing F5,











Click on button Help,we will navigate to the mentioned url address.

Application Command Example2

ApplicationCommandExample2.xaml











UI Display:
After pressing F5,











Now  we want to enable the commands in the above figure.

ApplicationCommandExample2.xaml.cs








UI Display:

After pressing F5,

Friday, January 10, 2014

Button Rotation Example1

ButtonAnimationExample3.xaml:




ButtonAnimationExample3.xaml.cs:


















UI Display:
After pressing F5,











Click on button,











We can see a rotation of button by 30 degree.

Thursday, January 9, 2014

Button Animation Example2

ButtonAnimationExample2.xaml:




ButtonAnimationExample2.xaml.cs:



















UI Display:
After pressing F5,











Click on control button












We can see the animated FontSize. 
Notes:Add a namespace named using System.Windows.Media.Animation;

ButtonAnimation Example1

We will see animations in button behavior
ButtonAnimationExample1.xaml:







UI Display:
After Pressing F5,











Now click on control button.











We can see the animated font size of content of  control button.
Notes:Add a namespace named using System.Windows.Media.Animation;

Copyright © Codingnodes,2014.All Rights Reserved.