Using code, I can set a UI element's background property to its default value by setting it to nothing
, i.e.
myControl.Background = Nothing
But how do I do this in XAML? In particular开发者_JAVA百科, I'm doing this in a Storyboard:
<Storyboard>
<ColorAnimation
Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)"
Duration="00:00:02.00"
To="DEFAULT_COLOR_HERE" />
</Storyboard>
Give this a shot
<Storyboard>
<ColorAnimation
Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)"
Duration="00:00:02.00"
To="{x:Null}" />
</Storyboard>
精彩评论