<Window x:Class="ListViewImageSelection.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="300" Width="400"> <Window.Resources> <BitmapImage x:Key="bike" UriSource="Images/bike.bmp"/> <BitmapImage x:Key="car" UriSource="Images/car.bmp"/> <BitmapImage x:Key="flower" UriSource="Images/flower.bmp"/> </Window.Resources> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition/> <ColumnDefinition Width="150"/> </Grid.ColumnDefinitions> <ListView Name="MyListView" Grid.Column="1" VerticalAlignment="bottom" HorizontalAlignment="Center" ScrollViewer.PanningMode="VerticalOnly"> <Image Source="{StaticResource bike}" Width="110" /> <Image Source="{StaticResource car}" Width="110" /> <Image Source="{StaticResource flower}" Width="110" /> </ListView> <Image Grid.Column="0" Stretch="Uniform" Source="{Binding ElementName=MyListView, Path=SelectedItem.ImageUri}"/> </Grid> </Window>
Set the Image binding path to the SelectedItem.Source
Image
SelectedItem.Source
<image grid.column="0" source="{Binding ElementName=MyListView, Path=SelectedItem.Source}" />
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)