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 7696213
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T21:43:38+00:00 2026-05-31T21:43:38+00:00

On a tabcontrol, I have no problem for fade in since the steps are

  • 0

On a tabcontrol, I have no problem for fade in since the steps are simple. We could put a trigger in the user control and the animation goes on as soon as it becomes visible. But the problem is, when I want to fade out, the control is now hidden and therefore it cannot complete it’s animation.

Here’s the example that I want to achieve: http://www.yoyonetwork.info/YoYoTabTestTestPage.html

And here’s the code:

    <TabControl IsSynchronizedWithCurrentItem="True" VerticalAlignment="Bottom" Name="TabControl1">
        <TabItem Width="70" Name="TabItem1">
            <Grid>
                <my:UserControl1 x:Name="UserControl1"/> <!-- my is the clr-namespace for usercontrols -->
            </Grid>
        </TabItem>
        <TabItem Width="100" Name="TabItem2">
            <Grid>                    
                <my:UserControl2 x:Name="UserControl2"/>
            </Grid>
        </TabItem>
    </TabControl>

In user controls:

    <Grid.Style>
        <Style TargetType="{x:Type Grid}">
            <Style.Triggers>
                <Trigger Property="IsVisible" Value="True">
                    <Trigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.5"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </Trigger.ExitActions>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Grid.Style>
  • 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-05-31T21:43:40+00:00Added an answer on May 31, 2026 at 9:43 pm

    You can’t do that from styles. You have to manually redefine TabControl, check for its SelectionChanged event, run animation from code and wait for its Completed event to change selectedIndex.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with the selected item in WPF-TabControl that could be reproduced
I have the next problem: TabControl has three TabPages. Every TabPage has its own
I got a strange problem. I have a tabcontrol and 3 tabs. On every
Problem I have a custom tab control using Chrome-shaped tabs that binds to a
I have a TabControl in my XAML which is just an empty control as
I'm trying to enable tabs functionality in the WebBrowser control. I have a TabControl
Problem I have Telerik TabControl and each tab content is a partial view. Everything
This is a C#, Winform question. I have a TabControl control and I use
I have the following xaml which resides in a wpf user control - <Grid>
I have a user control that is binded to a view model and I

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.