Surface sdk 2.0 에 있는 SurfaceListBox를 사용하는데

 

SurfaceListBoxItem의 배경색상이 불투명한 하얀색으로 나와서 구글링 결과 아래의 코드를 찾았다.

 

 

 

 

        <Style x:Key="BgTransparentStyle" TargetType="{x:Type my:SurfaceListBoxItem}"  >

            <Style.Triggers>

                <Trigger Property="IsSelected" Value="true">

                    <Setter Property="Foreground" Value="Transparent" />

                    <Setter Property="Background" Value="Transparent" />

                </Trigger>

                <Trigger Property="IsFocused" Value="true">

                    <Setter Property="Foreground" Value="Transparent" />

                    <Setter Property="Background" Value="Transparent" />

                </Trigger>

                <Trigger Property="IsEnabled" Value="true">

                    <Setter Property="Foreground" Value="Transparent" />

                    <Setter Property="Background" Value="Transparent" />

                </Trigger>

                <Trigger Property="IsMouseOver" Value="true">

                    <Setter Property="Foreground" Value="Transparent" />

                    <Setter Property="Background" Value="Transparent" />

                </Trigger>

            </Style.Triggers>

        </Style> 

 

                 ..................

 

        <my:SurfaceListBox Width="1080" Height="1480" ItemContainerStyle="{StaticResource BgTransparentStyle}"/>

 

 

 

 

[이미지1] 스타일 적용 전

 

 

 

 

 

 

[이미지2] 스타일 적용 후

+ Recent posts