在WPF中,如何将“折叠纸头”等样式设置为“矩形”或任何其他控件

在WPF中,如何将“折叠纸头”等样式设置为“矩形”或任何其他控件,wpf,styles,Wpf,Styles,我已经设法设计了一个矩形,这样在右上角有一个折叠纸头图像样式。我的要求是我需要有多文档视图图像的风格。我可以在xaml以下实现这一点。现在我需要设置折叠纸提示图像样式 提前谢谢 拉马斯 一个 两个 三 对于外部矩形,我将以下样式设置为Fill属性。 <Window x:Class="ExpandTreeViewWPF.Window2" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xm

我已经设法设计了一个矩形,这样在右上角有一个折叠纸头图像样式。我的要求是我需要有多文档视图图像的风格。我可以在xaml以下实现这一点。现在我需要设置折叠纸提示图像样式

提前谢谢

拉马斯


一个
两个
三

对于外部矩形,我将以下样式设置为Fill属性。

<Window x:Class="ExpandTreeViewWPF.Window2"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window2" Height="300" Width="300">
   <Window.Resources>
      <VisualBrush x:Key="Icon">
         <VisualBrush.Visual>
            <Canvas Width="10" Height="10">

               <Rectangle  Width="20" Height="20" Fill="White"  StrokeThickness=".2" Stroke="Gray"     Canvas.Left="1" Canvas.Top="2"/>
               <Rectangle Width="20" Height="20" Fill="White" StrokeThickness=".2" Stroke="Gray"  Canvas.Left="2" Canvas.Top="1"/>
               <Rectangle Width="20" Height="20" Fill="White"  StrokeThickness=".2" Stroke="Gray"  Canvas.Left="3" Canvas.Top="0"/>
            </Canvas>
         </VisualBrush.Visual>
      </VisualBrush>
   </Window.Resources>
    <Grid>
      <ListBox>
         <Border Background="{StaticResource Icon}">
         <ListBoxItem Padding="50">One</ListBoxItem>
            </Border>
         <ListBoxItem>Two</ListBoxItem>
         <ListBoxItem>Three</ListBoxItem>
      </ListBox>
   </Grid>
</Window>