unoplatform / uno

Open-source platform for building cross-platform native Mobile, Web, Desktop and Embedded apps quickly. Create rich, C#/XAML, single-codebase apps from any IDE. Hot Reload included! 90m+ NuGet Downloads!!
https://platform.uno
Apache License 2.0
9.05k stars 734 forks source link

[Desktop] ColorAnimation not working #18802

Open kucint opened 1 week ago

kucint commented 1 week ago

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

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