Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wpf 带有图像的listview itemtemplate_Wpf_User Interface_Listviewitem - Fatal编程技术网

Wpf 带有图像的listview itemtemplate

Wpf 带有图像的listview itemtemplate,wpf,user-interface,listviewitem,Wpf,User Interface,Listviewitem,我正在尝试创建一个类似的ListViewItem模板,但进展不大 以下是我迄今为止创建的样式: <ListView.ItemTemplate> <DataTemplate> <Grid> <Border HorizontalAlignment="Stretch" Margin="1.5" CornerRadius="5" BorderThickness="1,1,1,1" BorderBrush="#FF9

我正在尝试创建一个类似的
ListViewItem
模板,但进展不大

以下是我迄今为止创建的样式:

<ListView.ItemTemplate>
    <DataTemplate>
        <Grid>
            <Border HorizontalAlignment="Stretch" Margin="1.5" CornerRadius="5" BorderThickness="1,1,1,1" BorderBrush="#FF997137">
                <Border.Background>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FF4B4B4B" Offset="0" />
                        <GradientStop Color="#FF8F8F8F" Offset="1" />
                    </LinearGradientBrush>
                </Border.Background>
            </Border>
            <StackPanel Orientation="Horizontal" >
                <Image HorizontalAlignment="Left" Width="32" Source="/Images/stop.png" Stretch="Fill" Height="32" />
                <TextBlock Foreground="#FFECAD25" TextWrapping="Wrap" Width="150" >
                    This is a user control. The animation uses the attached BalloonShowing event.
                </TextBlock>
                <StackPanel Orientation="Vertical" >
                    <Image HorizontalAlignment="Right" Margin="0,10,5,0" VerticalAlignment="Top" Width="16" Height="16" Source="/Images/Close.png" Stretch="Fill"
                           Opacity="0.4" ToolTip="Delete" x:Name="Delete" />
                    <Image HorizontalAlignment="Right" Margin="0,5,5,0" VerticalAlignment="Top" Width="16" Height="16" Source="/Images/Close.png" Stretch="Fill"
                           Opacity="0.4" ToolTip="Edit" x:Name="Edit" />
                </StackPanel>
            </StackPanel>
        </Grid>
    </DataTemplate>
</ListView.ItemTemplate>

这是一个用户控件。动画使用附加的气球显示事件。

是否可以扩展图像/图标下方的文本?

我不相信有任何现成的方法可以使用“文本块”来实现这一点


但是,如果您能够使用
FlowDocument
控件,这里有一些选项:,。

据我所知,没有。至少不能使用简单的图像和文本块。 不过,FlowDocument似乎是一个很好的解决方案, 有关更多信息,请查看此链接: