WPF: Wie setze ich die Hintergrundeigenschaft eines UI -Elements auf Null/Nichts/Standard in XAML?

StackOverflow https://stackoverflow.com/questions/1691393

Frage

Mit Code kann ich die Hintergrundeigenschaft eines UI -Elements auf ihren Standardwert einstellen nothing, dh

myControl.Background = Nothing

Aber wie mache ich das in XAML? Insbesondere mache ich das in einem Storyboard:

<Storyboard>
    <ColorAnimation 
        Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" 
        Duration="00:00:02.00" 
        To="DEFAULT_COLOR_HERE" />
</Storyboard>
War es hilfreich?

Lösung

Schießen

<Storyboard>
    <ColorAnimation 
        Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" 
        Duration="00:00:02.00" 
        To="{x:Null}" />
</Storyboard>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top