I have Defined a DataTemplate for ListView to Display the fileInfo details. This is the DataTemplate
<DataTemplate x:Key="srchFileListTemplate">
<StackPanel>
<WrapPanel>
<TextBlock FontWeight="Bold" FontFamily="Century Gothic"
Text="FileName :"/>
<TextBlock Margin="10,0,0,0" FontWeight="Bold"
FontFamily="Century Gothic" Text="{Binding Path=Name}"/>
</WrapPanel>
<WrapPanel>
<TextBlock FontFamily="Century Gothic" Text="FilePath :"/>
<TextBlock Margin="20,0,0,0" FontFamily="Century Gothic"
Text="{Binding Path = DirectoryName}"/>
</WrapPanel>
<WrapPanel>
<TextBlock FontFamily="Century Gothic" Text="File Size :"/>
<TextBlock Margin="20,0,0,0" FontFamily="Century Gothic"
Text="{Binding Path = Length}"/>
<TextBlock Text="Bytes"/>
</WrapPanel>
<WrapPanel>
<TextBlock FontFamily="Century Gothic" Text="File Extension:"/>
<TextBlock Margin="20,0,0,0" FontFamily="Century Gothic"
Text="{Binding Path = Extension}"/>
</WrapPanel>
</StackPanel>
</DataTemplate>
ImagesSource
for the ListView
is List<FileInfo>
I have to add a customized icon according to the Extension of the file to the List. Is it possible to pass the extension to a method to get the icon path in the existing DataTemplate?