Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8717213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:15:26+00:00 2026-06-13T06:15:26+00:00

When the user shift pages in my application, simple animation should fade out items

  • 0

When the user shift pages in my application, simple animation should fade out items before shifting, but it’s not working and going for the shift immediately.

Code:

        public PageClass()
        {
            BackKeyPress += OnBackKeyPressed;
        }

        void OnBackKeyPressed(object sender, CancelEventArgs e)
        {
            foreach (var control in ContentPanel.Children)
                MainPage.FadeOutObject(control);

            var translation = new TranslateTransform();

            PageTitle.RenderTransform = translation;

            var s = new Storyboard();
            Storyboard.SetTarget(s, translation);
            Storyboard.SetTargetProperty(s, new PropertyPath(TranslateTransform.YProperty));

            s.Children.Add(
                    new DoubleAnimation()
                    {
                        From = -300,
                        To = 0,
                        Duration = new Duration(TimeSpan.FromSeconds(2.0)),
                        EasingFunction = new PowerEase { EasingMode = EasingMode.EaseInOut }
                    });

            s.Begin();

            s.Completed += (object sd, EventArgs ea) =>
            {
                NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
            }; 
        }

Now, this does not work, it goes back to the MainPage straight away, does anyone have a clue?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T06:15:27+00:00Added an answer on June 13, 2026 at 6:15 am

    Try adding e.Cancel to stop the previous page from being handled automatically, since you’re already telling it which page it should go to.

    void OnBackKeyPressed(object sender, CancelEventArgs e)
    {
        e.Cancel = true;
    
        foreach (var control in ContentPanel.Children)
                MainPage.FadeOutObject(control);
    
        //...rest of your code
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to send a textarea's data when user presses shift + enter ,
I want to shift all the pages of an existing pdf document right one
I am learning CakePHP 2.0, and created a sample test application, where user can
I want to get keyboard modifiers (like shift or option keys) when user click
is it possible to display all the pages that user have visited?For example, my
I'm trying to figure out when the user presses the control key in an
I have a User and a Shift. Users have many shifts. class User <
User Story: Action for Facebook that has open graph object. For this I need
User inserts a string in a html form input on browser. This string is
User has many Tracks, through Favorite. Favorite has some extra per-user meta-data about the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.