Hi,
I'm following this tutorial Customizing a ViewCell
However, I don't understand where can I put the last piece of code at the bottom of the tutorial..
<DataTemplate x:Key="ListViewItemTemplate"> <Grid Background="LightYellow"> <Grid.Resources> <local:ConcatImageExtensionConverter x:Name="ConcatImageExtensionConverter" /> </Grid.Resources> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="0.40*" /> <ColumnDefinition Width="0.40*"/> <ColumnDefinition Width="0.20*" /> </Grid.ColumnDefinitions> <TextBlock Grid.ColumnSpan="2" Foreground="#7F3300" FontStyle="Italic" FontSize="22" VerticalAlignment="Top" Text="{Binding Name}" /> <TextBlock Grid.RowSpan="2" Grid.Column="1" Foreground="#267F00" FontWeight="Bold" FontSize="12" VerticalAlignment="Bottom" Text="{Binding Category}" /> <Image Grid.RowSpan="2" Grid.Column="2" HorizontalAlignment="Left" VerticalAlignment="Center" Source="{Binding ImageFilename, Converter={StaticResource ConcatImageExtensionConverter}}" Width="50" Height="50" /> <Line Grid.Row="1" Grid.ColumnSpan="3" X1="0" X2="1" Margin="30,20,0,0" StrokeThickness="1" Stroke="LightGray" Stretch="Fill" VerticalAlignment="Bottom" /> </Grid> </DataTemplate>
Does anyone can help me?
Answers
@Emixam23 - it mentions to put it in the application-level resource dictionary.
Go to your windows project and find App.xaml
In there add the data template to
Ho ok I didn't know neither where to put the resource dictionary nor in which file I had to do (create a new file or put in existing file) Thank !