Final result will be an app in which whenever we will tap the ball it will show movement with in border and ball will stop on taping ball (in movement) again. You can use it to develop game that records your score on every tap.
We are going to handle events (start and stop) of animation.
First step is to create a new Universal Windows Platform(UWP) in Visual Studio and open it in blend.

In this article I am using a simple example which includes Rectangle and circle. Rectangle behaves like border and our ball(circle) show different movement within the border(Rectangle).
Create a rectangle and change its thickness, border color to whatever you want. Adjust them on screen and according to device you have selected I am using 13.3″ Desktop 1280X720.

Create a new storyboard and change movement of ball according to time as in the following screenshot.

In blend we can use Easing Functions which give some special effect to our animations.
For more information about Easing Function visit the following link.

Now create a function to handle click on ball.
- public static bool check = true;
- private void ellipse_Tapped(object sender, TappedRoutedEventArgs e)
- {
- if (check)
- {
- playit.Begin(); //playit is the name of storyboard
- check = false;
- }
- else if (!check)
- {
- playit.Stop();
- check = true;
- }
- }
Final step is to change the repetition of animation to forever, it will show continuous movements. Run the app and tap the ball. It will start moving in rectangle, tap it again to stop.

Add Score feature in app, a textblock and name it.
Go to tapped function and replace code.
- public static int score = 0;
- private void ellipse_Tapped(object sender, TappedRoutedEventArgs e)
- {
- playit.Begin(); //its not necessary to write it here you can add the line //in button event so that on every tap it doesn’t start //from initial //position
- score += 1;
- textBlock.Text = score.ToString();
- }



Hadshana KamalanathanTOP 100Posted Jul 22, 2018, 12:25 AM EDT
Good one...
kalu singh raoPosted Jul 18, 2016, 10:04 PM EDT
Nice...
Asfend YarPosted Feb 29, 2016, 8:49 AM EST
thanks for share
Asfend YarPosted Feb 27, 2016, 9:30 AM EST
good
Ayyaz AhmadPosted Nov 23, 2015, 5:22 AM EST
thank u everyone
Kiranteja JallepalliPosted Nov 23, 2015, 3:14 AM EST
Good Work Ayyaz Ahmad,Keep Posting..
Sibeesh VenuTOP 100Posted Nov 22, 2015, 11:09 PM EST
Nice Share
Harshad PansuriyaPosted Nov 22, 2015, 9:53 PM EST
Nice one
Mukesh KumarPosted Nov 22, 2015, 6:44 PM EST
Great One
Sourabh SomaniTOP 100Posted Nov 22, 2015, 6:47 AM EST
Nice :)