2012-05-10 4 views
1

내부 그림자를 실현하는 데이 코드가 있습니다.내부 그림자 문제

어쨌든 TextBlock 등이 포함되어 있습니다. 필요하지 않습니다. 내면의 섀도우 만 필요합니다.

문제가 here을 설명 근처는하지만 내부 그림자가 ...

그래서 내부 그림자를 유지하지만 글꼴에 적용되지 않습니다

는 제발 도와주세요 그것을 해결하기 위해. 고맙습니다!

<DataTemplate x:Key="RSSItemTemplate"> 
      <Border Background="LightGray" BorderBrush="DarkGray" Margin="0,0,0,5" BorderThickness="1" ClipToBounds="True"> 
       <Border Background="Transparent" BorderBrush="Black" BorderThickness="1" Margin="-2"> 
        <Border.Effect> 
         <DropShadowEffect ShadowDepth="0" BlurRadius="5" /> 
        </Border.Effect> 
        <Grid> 
         <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
          <Image> 
          </Image> 
          <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
           <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
            <TextBlock Text="{Binding Path=PublishDate}" Margin="0,0,5,0" /> 
            <TextBlock Text="{Binding Path=Title}" TextWrapping="Wrap" /> 
           </StackPanel> 
           <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
            <TextBlock Text="{Binding Path=Description}" Margin="0,5,0,0" TextWrapping="Wrap" /> 
           </StackPanel> 
          </StackPanel> 
         </StackPanel> 
        </Grid> 
       </Border> 
      </Border> 
     </DataTemplate> 
    </UserControl.Resources> 

    <Grid> 
     <ItemsControl x:Name="MainRoot" ItemTemplate="{StaticResource RSSItemTemplate}" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" /> 
    </Grid> 

답변

2

시도는 다음과 같이 수정합니다 :

<DataTemplate x:Key="RSSItemTemplate"> 
     <Border Background="LightGray" BorderBrush="DarkGray" Margin="0,0,0,5" BorderThickness="1" ClipToBounds="True"> 
       <Grid> 
        <Border Background="Transparent" BorderBrush="Black" BorderThickness="1" Margin="-2"> 
         <Border.Effect> 
          <DropShadowEffect ShadowDepth="0" BlurRadius="5" /> 
         </Border.Effect> 
        </Border> 
        <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
         <Image> 
         </Image> 
         <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
           <TextBlock Text="{Binding Path=PublishDate}" Margin="0,0,5,0" /> 
           <TextBlock Text="{Binding Path=Title}" TextWrapping="Wrap" /> 
          </StackPanel> 
          <StackPanel Orientation="Horizontal" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"> 
           <TextBlock Text="{Binding Path=Description}" Margin="0,5,0,0" TextWrapping="Wrap" /> 
          </StackPanel> 
         </StackPanel> 
        </StackPanel> 
       </Grid> 
     </Border> 
    </DataTemplate> 
    <!-- the rest of the code here --> 

당신이 설명 된대로 테두리하지만 내부의 구성 요소에 영향을주지 않고 내부 그림자를 갖는 작동하는 것 같다.

+0

Lucas! –

+0

다른 질문이 있으시면 알려주십시오. 도와 드리겠습니다. :) –