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

[Desktop] ColorAnimation not working #18802

Open
kucint opened this issue Nov 15, 2024 · 0 comments
Open

[Desktop] ColorAnimation not working #18802

kucint opened this issue Nov 15, 2024 · 0 comments
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification

Comments

@kucint
Copy link

kucint commented Nov 15, 2024

Current behavior

On Desktop framework: ColorAnimation is not working
On WinAppSdk framework: works fine

<Grid BorderThickness="3">
    <Grid.BorderBrush>
        <SolidColorBrush x:Name="SelectionFrameBorderBrush" Color="Transparent" />
    </Grid.BorderBrush>
    
    <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="SelectionStates">
            <VisualState x:Name="Selected">
                <Storyboard>
                    <ColorAnimation Storyboard.TargetName="SelectionFrameBorderBrush" Storyboard.TargetProperty="Color" To="Red" Duration="0:0:0.2" />
                </Storyboard>
            </VisualState>
            <VisualState x:Name="Normal">
                <Storyboard>
                    <ColorAnimation Storyboard.TargetName="SelectionFrameBorderBrush" Storyboard.TargetProperty="Color" To="Transparent" Duration="0:0:0.2" />
                </Storyboard>
            </VisualState>
        </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>

    <CheckBox Content="CheckBox"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              IsChecked="False"
              Checked="CheckBox_Checked"
              Unchecked="CheckBox_Unchecked">
  </CheckBox>
</Grid>
  private void CheckBox_Checked(object sender, RoutedEventArgs e)
      => VisualStateManager.GoToState(this, "Selected", true);

  private void CheckBox_Unchecked(object sender, RoutedEventArgs e)
      => VisualStateManager.GoToState(this, "Normal", true);

Expected behavior

On Desktop framework: ColorAnimation of brush opacity shall work as on WinAppSdk

How to reproduce it (as minimally and precisely as possible)

MINIMAL REPRO PROJECT : UnoColorAnimationApp.zip

STEPS TO REPRODUCE

  • Run the app
  • click on checkbox
    • on WinAppSdk all is fine, animated Red Border appears
    • on Desktop: Red Border appears but without animation
      image

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

"Uno.Sdk": "5.5.43"
"version": "9.0.100" // dotnet

Affected platforms

Skia (WPF)

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@kucint kucint added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
Development

No branches or pull requests

1 participant