ListView won't clip
Posted: 07 Aug 2017, 14:55
Hi all,
I have tried everything from canvs to Border with ClipToBounds set tro True, bu I cannot get ListView to NOT draw text, Images, anything, exceeding or covering all top and bottom. Any help welcome, here is the small code snippet. Viewtexture and ViewName are methods returning an image and a string, respectively.
I have tried everything from canvs to Border with ClipToBounds set tro True, bu I cannot get ListView to NOT draw text, Images, anything, exceeding or covering all top and bottom. Any help welcome, here is the small code snippet. Viewtexture and ViewName are methods returning an image and a string, respectively.
Code: Select all
<ListView ClipToBounds="True" Visibility="{Binding ElementName=ExpanderControl, Converter={StaticResource convBoolVis}, Path=IsChecked}" Name="ViewsList" ItemsSource="{Binding Path=ViewListAccessor, Mode=OneWay}" Foreground="White" Background="Gray">
<ListView.View>
<GridView>
<GridViewColumn Header="Thumbnail">
<GridViewColumn.CellTemplate >
<DataTemplate>
<StackPanel Orientation="Vertical" Width="{Binding ActualWidth, ElementName=ImgCell}" Height="{Binding ActualHeight, ElementName=ImgCell}" >
<Image Source="{Binding Path=ViewTexture}" MaxHeight="240" MaxWidth="240"/>
<TextBlock Text="{Binding ViewName}" HorizontalAlignment="Center" Margin="2,2,2,2" ClipToBounds="True"/>
</StackPanel>
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>