This will give you two columns with one button with an image. if I did this, I would put the command on my element so that I could attach my button to it.
<ListView Name="myListView"> <ListView.View> <GridView> <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <Button Content="Click Me" Margin="0" VerticalAlignment="Center" Click="Button_Click" /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <Image Source="{Binding ImageSource}" /> </DataTemplate> </GridViewColumn.CellTemplate> </GridViewColumn> </GridView> </ListView.View> </ListView>
You will need to have a source of elements containing elements that have the ImageSource property
source share