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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:16:13+00:00 2026-06-11T05:16:13+00:00

I have a control that can appear on the left- or right-hand side of

  • 0

I have a control that can appear on the left- or right-hand side of a window depending on the value of a viewmodel property (which changes as a result of a button click elsewhere in the UI). I’m using DataTriggers to achieve this positioning:

<DataTrigger Binding="{Binding ShowOnLeft}" Value="True">
    <Setter Property="HorizontalAlignment" Value="Left"/>
</DataTrigger>
<DataTrigger Binding="{Binding ShowOnLeft}" Value="False">
    <Setter Property="HorizontalAlignment" Value="Right"/>
</DataTrigger>

I now want to make the control fade in when it’s position changes, so I added these triggers:-

<Trigger Property="HorizontalAlignment" Value="Left">
    <Trigger.EnterActions>
        <BeginStoryboard>
            <Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="0.8" Duration="0:0:0.2"/>
            </Storyboard>
        </BeginStoryboard>
    </Trigger.EnterActions>
</Trigger>

<Trigger Property="HorizontalAlignment" Value="Right">
    <Trigger.EnterActions>
        <BeginStoryboard>
            <Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.0" To="0.8" Duration="0:0:0.2"/>
            </Storyboard>
        </BeginStoryboard>
    </Trigger.EnterActions>
</Trigger>

However it produces some odd results. The fade works the first time HorizontalAlignment changes to “Left”, but not on subsequent attempts. However the fade will happily work every time HorizontalAlignment changes to “Right”. It partly seems to be down to trigger order – if I swap the two triggers then the reverse happens (the fade only works the first time I set HorizontalAlignment to “Right”, but works every time for “Left”).

What am I doing wrong?

  • 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-11T05:16:15+00:00Added an answer on June 11, 2026 at 5:16 am

    Maybe a wild guess, but I have had similar (unwanted) behavior some time ago. Finally, I had succes with the property FillBehavior of a DoubleAnimation set to Stop (the default is HoldEnd).

    Read this to learn more about this property / enumeration.

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

Sidebar

Related Questions

I need a button-like control that can have a Checked property, so that when
Have a liquid layout that has fixed width for left side and elastic right
I have a custom control that can be added multiple times to a form.
Is there a way to have a custom control send events that can be
I have a custom control that inherits from UserControl , and I can't get
Currently I have a third party control that generates a Metafile. I can save
I have this problem that I can ref a button for control it. I
Can the calendar control be customsised so that, say you have a system of
I have a control that has a Filter property that expects a function that
In my WPF app, I have a feedback control that I want to appear

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.