Skip to content

Duration on Storyboard breaks animation #3434

Open

Description

@MartinZikmund

Current behavior

Bug reported on Stack Overflow by dp901.

Consider the following XAML:

<Grid Background="White" BorderBrush="Gray" BorderThickness="1" Width="250" Height="250">
    <VisualStateManager.VisualStateGroups>
        <VisualStateGroup x:Name="LightStates">
            <VisualState x:Name="LightFlashing">
                <Storyboard RepeatBehavior="Forever">
                    <DoubleAnimation Duration="0:0:2.0" From="1" To="0" Storyboard.TargetName="AnimatedEllipse" Storyboard.TargetProperty="Opacity" />
                </Storyboard>
            </VisualState>
        </VisualStateGroup>
    </VisualStateManager.VisualStateGroups>

    <Ellipse x:Name="AnimatedEllipse" Height="126" Width="126">
        <Ellipse.Fill>
            <SolidColorBrush x:Name="AnimatedEllipseBrush" Color="Red" />
        </Ellipse.Fill>
    </Ellipse>
</Grid>

This works fine on all Uno targets. However, when the Duration attribute is moved from DoubleAnimation to Storyboard the animation breaks (supposedly on all platforms, tested on Android and WASM.

Expected behavior

The animation should work the same way whether Duration is on Storyboard or not as in UWP.

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

See above.

Environment

Nuget Package: Uno.UI

Package Version(s): 2.4.4

Affected platform(s):

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renderers for Xamarin.Forms
  • macOS
  • Windows
  • Build tasks
  • Solution Templates

Visual Studio:

  • 2017 (version: )
  • 2019 (version: )
  • for Mac (version: )

Activity

  1. added
    kind/bug
    triage/untriaged
    on Jun 24, 2020
  2. added
    platform/android 🤖
    platform/ios 🍎
    platform/wasm 🌐
    and removed
    triage/untriaged
    on Jul 2, 2020
  3. modified the milestone: 3.1 on Aug 28, 2020
  4. added
    project/animations 🎡
    on Sep 21, 2020
  5. added
    difficulty/tbd
    on Feb 15, 2021
  6. added
    difficulty/medium 🤔
    and removed
    difficulty/tbd
    on Jun 1, 2021
  7. changed the title [-]Duration on Storyboard breaks animation[/-] [+]`Duration` on `Storyboard` breaks animation[/+] on Jun 14, 2023
  8. MartinZikmund commented on Jul 17, 2025

    @MartinZikmund
    MemberAuthor

    This is likely still relevant for Skia targets

  9. MartinZikmund commented on Apr 7, 2026

    @MartinZikmund
    MemberAuthor

    Repro generator

    Runtime test(s) added in branch dev/mazi/repro/3434:

    • src/Uno.UI.RuntimeTests/Tests/Windows_UI_Xaml_Media_Animation/Given_Storyboard.cs → When_Storyboard_Duration_Set_Animation_Runs

    ⚠️ The test(s) pass on current master (Skia Desktop) — Storyboard.Duration produces the same animation result as DoubleAnimation.Duration. The original bug was reported on Android, WASM, and iOS where the native animation paths may not respect Storyboard.Duration. The branch provides a regression guard for the managed path.

  10. self-assigned this
    on Jun 4, 2026
  11. removed
    kind/bug
    difficulty/medium 🤔
    on Jun 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

has-repro-branchplatform/android 🤖platform/ios 🍎platform/wasm 🌐project/animations 🎡

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions