当前位置: 代码迷 >> .NET新技术 >> WPF ListView中一个列如其实现图片加字符
  详细解决方案

WPF ListView中一个列如其实现图片加字符

热度:353   发布时间:2016-04-25 01:27:13
WPF ListView中一个列如果实现图片加字符
WPF ListView中一个列如果实现图片加字符 如这个列中是状态图标+名称,是通过数据绑定上去的,里面是一个Image和Labe,但是图片跟文字叠加了,我试过用grid来定他们的格局使他们不重叠,结果还是这样的。我应该怎样解决,使他们不重叠。

xaml代码如下

<GridViewColumn Header="状态" Width="80" x:Name="nameFine" >
                                                <GridViewColumn.CellTemplate>
                                                    <DataTemplate>                                                     
                                                       <Grid Width="60">
                                                            <Grid.ColumnDefinitions>
                                                                <ColumnDefinition Width="*" />
                                                                <ColumnDefinition Width="2*" />
                                                            </Grid.ColumnDefinitions>                                                           
                                                            <Image Height="18" Width="18"  Source="{Binding Path=Fine,Converter={StaticResource weekConvert}}">
                                                            </Image>
                                                            <TextBlock Width="Auto" TextAlignment ="Center" Text="{Binding Path=Fine}" Grid.ColumnSpan="2" />
                                                          
                                                        </Grid>
                                                       
  相关解决方案
本站暂不开放注册!
内测阶段只得通过邀请码进行注册!