WPF : XAML에서 UI 요소의 배경 속성을 null/nothing/default로 설정하려면 어떻게해야합니까?

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

문제

코드를 사용하여 UI 요소의 배경 속성을 설정하여 기본값으로 설정할 수 있습니다. nothing, 즉

myControl.Background = Nothing

그러나 XAML에서 어떻게해야합니까? 특히 스토리 보드 에서이 작업을 수행합니다.

<Storyboard>
    <ColorAnimation 
        Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" 
        Duration="00:00:02.00" 
        To="DEFAULT_COLOR_HERE" />
</Storyboard>
도움이 되었습니까?

해결책

이것을 찍으십시오

<Storyboard>
    <ColorAnimation 
        Storyboard.TargetProperty="(Background).(SolidColorBrush.Color)" 
        Duration="00:00:02.00" 
        To="{x:Null}" />
</Storyboard>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top