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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:28:25+00:00 2026-05-14T06:28:25+00:00

Background: I have a WPF UserControl (MainControl – not shown in code below) that

  • 0

Background:

I have a WPF UserControl (MainControl – not shown in code below) that contains another one (called MyControl in the code below).

MainControl has it’s DataContext set to an object, that has a Project-property.
When MainControl loads, the Project-property is always null.

The problem:

When MainControl loads, I want to fade in the MyControl using a special storyboard (only used this one time (this “specialFadeInStoryboard” changes Opacity-property of MyControl from 0 to 1).

When the Project-property is set to a value other than null, I want the MyControl to fade out using the “fadeOutStoryboard” (changes Opacity-property of MyControl to 0) and if it’s set to null afterwards I want to fade it in again this time using the “fadeInStoryboard” (changes Opacity-property of MyControl to 1).

However, after adding the code for the “specialFadeInStoryboard”, the MyControl is never faded out…

What am I doing wrong?

<local:MyControl Visibility="{Binding RelativeSource={RelativeSource Self}, Path=Opacity, Converter={StaticResource opacityToVisibilityConverter}, Mode=OneWay}">
    <local:MyControl.Style>
        <Style>
            <Style.Triggers>
                <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                    <BeginStoryboard Storyboard="{StaticResource specialFadeInStoryboard}"/>
                </EventTrigger>
                <DataTrigger Binding="{Binding Project, Converter={StaticResource nullToBooleanConverter}, Mode=OneWay}" Value="True">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource fadeOutStoryboard}"/>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard Storyboard="{StaticResource fadeInStoryboard}"/>
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </local:MyControl.Style>
</local:MyControl>
  • 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-14T06:28:25+00:00Added an answer on May 14, 2026 at 6:28 am

    You might need to stop the specialFadeInStoryboard before the other fading storyboards begin running. You can do that with something like this:

    <DataTrigger.EnterActions>
        <StopStoryboard BeginStoryboardName="specialFadeInStoryboard"/>
        <BeginStoryboard Storyboard="{StaticResource fadeOutStoryboard}"/>
    </DataTrigger.EnterActions>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an interesting problem. I've created a WPF UserControl which contains a button
I have a WPF window that is run on a background thread as a
I have a WPF app that draws text on an Aero glass background. The
Please help! Background info I have a WPF application which accesses a SQL Server
I'm new to WPF and come from a WinForms background and have a fairly
I have a button with a transparent background on a wpf window. Problem is,
Background: I have a kubuntu laptop right now that I can't use wirelessly, i.e.
Background: we have an application that generates reports from HTML (that may or may
I have a WPF UserControl nested inside an ElementHost in a WinForm UserControl intended
I'm using WPF within Visual Studio 2008. I have a simple WPF UserControl with

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.