microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.36k stars 678 forks source link

ProgressRing auto stopped animate after switch tabviewitem back #6354

Closed shuice closed 2 years ago

shuice commented 2 years ago

Describe the bug

If the ProgressRing is inside the TabviewItem, after switching to another TabViewItem and then switching back, the ProgressRing will stop the animation, and it should keep the animation.

Steps to reproduce the bug

  1. Create an empty UWP application and add a nuget reference for WinUI 2.7
  2. Add muxc:TabView to the root Grid of MainPage.xaml, add two muxc:TabViewItems to the muxc:TabView
  3. Add two controls to the first muxc:TabViewItem, one is muxc:ProgressRing, the other is Windows.UI.Xaml.Controls.ProgressRing, these two ProgressRings do not set any properties
  4. Run the program and find that both ProgressRings are performing animation
  5. Switch to the second tab, and then switch to the first tab
  6. It is found that musc: ProgressRing stops the animation, and the animation of Windows.UI.Xaml.Controls.ProgressRing remains

Expected behavior

musc: ProgressRing keep animate as Windows.UI.Xaml.Controls.ProgressRing

Screenshots

stopped

NuGet package version

Microsoft.UI.Xaml 2.7.0

Windows app type

Device form factor

Desktop

Windows version

May 2021 Update (19043)

Additional context

I have test the following environment, they have the same behavior.

case 1: Win11 Build 22504.rs_prerelease.211112-1650 + UWP(nuget WinUI2.7) case 2: Win11 Build 22504.rs_prerelease.211112-1650 + Win32 Packaged(Microsoft.WindowsAppSDK 1.0.0 11/17/2021) case 3: Windows10 21H1 19043.1237 + UWP(nuget WinUI2.7)

sample souce code can be found here, sorry about the wrong spell issue(issure).

The key code is here:

<Page
    x:Class="winui_progressbar_stop_animate_issure.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:winui_progressbar_stop_animate_issure"
    xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
    xmlns:wuxc="using:Windows.UI.Xaml.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">

    <Grid>
        <muxc:TabView>
            <muxc:TabViewItem Header="Tab1">
                <StackPanel>
                    <wuxc:ProgressRing IsActive="True"></wuxc:ProgressRing>
                    <muxc:ProgressRing IsActive="True"></muxc:ProgressRing>
                </StackPanel>
            </muxc:TabViewItem>
            <muxc:TabViewItem Header="Tab2">

            </muxc:TabViewItem>
        </muxc:TabView>
    </Grid>
</Page>
roxk commented 2 years ago

Same as #5046. Now that I have migrated from WinUI 3 to 2.7+, I can reproduce the same issue in both progress ring and refresh container.

shuice commented 2 years ago

Same as #5046. Now that I have migrated from WinUI 3 to 2.7+, I can reproduce the same issue in both progress ring and refresh container.

yeap, your are right, it's same.

StephenLPeters commented 2 years ago

@karenbtlai Is there code that stops the AVP when the controls is unloaded?

karkarl commented 2 years ago

@karenbtlai Is there code that stops the AVP when the controls is unloaded?

It only stops when IsActiveProperty and IsIndeterminateProperty is changed.

bogdan-patraucean commented 2 years ago

I also encountered this problem in WinUI 3.0.