ビューステートでユーザーコントロール上でストーリーボードをトリガーしているときに、次のような例外が発生しています。UWP/Winrtアプリケーションのストーリーボードにおける断続的な例外
WinRTの情報:指定されたオブジェクトにTargetProperty(背景)(SolidColorBrush.Color)を解決することはできません
マイストーリーボードは以下の通りです -
<StackPanel Orientation="Horizontal">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup>
<VisualState x:Name="Connecting">
<Storyboard RepeatBehavior="Forever">
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd1" Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)">
<DiscreteColorKeyFrame Value="#F7F7F7" KeyTime="0:0:0" />
<DiscreteColorKeyFrame Value="#6CBF25" KeyTime="0:0:1" />
<DiscreteColorKeyFrame Value="#F7F7F7" KeyTime="0:0:5" />
</ColorAnimationUsingKeyFrames>
<ColorAnimationUsingKeyFrames Storyboard.TargetName="Bd1" Storyboard.TargetProperty="(BorderBrush).(SolidColorBrush.Color)">
<DiscreteColorKeyFrame Value="#919191" KeyTime="0:0:0" />
<DiscreteColorKeyFrame Value="#01851F" KeyTime="0:0:1" />
<DiscreteColorKeyFrame Value="#919191" KeyTime="0:0:5" />
</ColorAnimationUsingKeyFrames>
</Storyboard>
</VisualState>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
<Border x:Name="Bd1" Height="5" />
</StackPanel>
そして、私はそれをトリガーする方法
VisualStateManager.GoToState(this, "Connecting", false);
。
この視覚的な状態は、通常、UserControlの負荷ですぐにトリガされます。