Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to add a DiscreteObjectKeyFrame into CompoundSettings.Sequence? #102

Open
GF-Huang opened this issue Apr 9, 2022 · 2 comments

Comments

@GF-Huang
Copy link

GF-Huang commented Apr 9, 2022

What I want to do?

  • Set Visibility to Visible before FadeIn.
  • Set Visibility to Collapsed after FadeOut.

In vanilla way, it looks like this:

<Style TargetType="hc:SimplePanel">
  <Setter Property="Visibility" Value="Collapsed" d:Value="Visible" />
  <Style.Triggers>
    <DataTrigger Binding="{Binding IsLoading}" Value="True">
      <DataTrigger.EnterActions>
        <BeginStoryboard>
          <Storyboard>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
              <DiscreteObjectKeyFrame KeyTime="0:0:0" Value="{x:Static Visibility.Visible}" />
            </ObjectAnimationUsingKeyFrames>
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:0.5" />
          </Storyboard>
        </BeginStoryboard>
      </DataTrigger.EnterActions>
      <DataTrigger.ExitActions>
        <BeginStoryboard>
          <Storyboard>
            <DoubleAnimation Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:0.5" />
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility">
              <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Collapsed}" />
            </ObjectAnimationUsingKeyFrames>
          </Storyboard>
        </BeginStoryboard>
      </DataTrigger.ExitActions>
    </DataTrigger>
  </Style.Triggers>
</Style>

Effect:

JHzRKVnyza

@assassin316
Copy link
Collaborator

Hi @GF-Huang I apologize for the long delay, I will get back to you as soon as I can 👍

@assassin316
Copy link
Collaborator

@GF-Huang aahh, I understand what you want, and this has been a feature I've not yet implemented. I've wanted to implement a property such as xf:Animations.HideOnFaded="True", which when an element reaches an Opacity of 0 (and vice-vrsa), I would essentially set IsHitTestVisible="False" and maybe even set Visibility like you mention here. I hope I can eventually achieve it because there are some scenarios that it can be useful, and yours is one of them. I'm currently working on a version to bump the nuget packages for Uno.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants