microsoft / XamlBehaviors

This is the official home for UWP XAML Behaviors on GitHub.
MIT License
702 stars 112 forks source link

Should share storyboard is paused between all ControlStoryboardAction instances. #107

Open h82258652 opened 8 years ago

h82258652 commented 8 years ago

if two or more ControlStoryboardAction instances use the same storyboard, is paused will be wrong.

skendrot commented 8 years ago

Is there an issue for this PR? Do you have a use case for this PR?

h82258652 commented 8 years ago

@skendrot

        <CommandBar>
            <CommandBar.Resources>
                <Storyboard x:Key="RefreshingStoryboard">
                    <DoubleAnimation RepeatBehavior="Forever"
                                     Storyboard.TargetName="RefreshIcon"
                                     Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)"
                                     From="0"
                                     To="360"
                                     Duration="0:0:1" />
                </Storyboard>
            </CommandBar.Resources>
            <AppBarButton Label="Refresh">
                <interactivity:Interaction.Behaviors>
                    <core:DataTriggerBehavior Binding="{Binding Path=IsBusy}"
                                              Value="True">
                        <media:ControlStoryboardAction ControlStoryboardOption="TogglePlayPause"
                                                       Storyboard="{StaticResource RefreshingStoryboard}" />
                    </core:DataTriggerBehavior>
                    <core:DataTriggerBehavior Binding="{Binding Path=IsBusy}"
                                              Value="False">
                        <media:ControlStoryboardAction ControlStoryboardOption="Pause"
                                                       Storyboard="{StaticResource RefreshingStoryboard}" />
                    </core:DataTriggerBehavior>
                </interactivity:Interaction.Behaviors>
                <AppBarButton.Icon>
                    <SymbolIcon x:Name="RefreshIcon"
                                RenderTransformOrigin="0.5,0.5"
                                Symbol="Refresh">
                        <SymbolIcon.RenderTransform>
                            <RotateTransform />
                        </SymbolIcon.RenderTransform>
                    </SymbolIcon>
                </AppBarButton.Icon>
            </AppBarButton>
        </CommandBar>

When IsBusy is true, the storyboard should be continue to play. But in fact, it don't work for me.

By the way, is this project still alive? The nuget package had 6 months no update.

mgoertz-msft commented 8 years ago

It sure is alive. We listen to you guys when it is time to produce another NuGet update. We have heard request recently and put it on our backlog. Due to higher priority issues though we haven't been able to do so yet.

h82258652 commented 4 years ago

Link this to https://github.com/microsoft/microsoft-ui-xaml/issues/3103