I have a grid with repeated columns with same style but different names the name are important for me in code behind so i decided to create a template to repeat the element and read the names from an XML file but i found out i can not use binding for name property please kindly help me sooooooooooooooooooooooooooon
here is a part of my code:
<DataTemplate x:Key="weekItemTemplate">
<Gridx:Name="{Binding XPath=Container}" Style="{DynamicResource GridStyle}">
<Grid.RowDefinitions>
<RowDefinition Height="0.9*"/>
<RowDefinition Height="0.1*"/>
</Grid.RowDefinitions>
<Rectangle x:Name="Rectangle" Grid.Row="0" Margin="0,0,0,0.063"/>
<TextBlock x:Name="Christian" HorizontalAlignment="Left" Width="18.52" Grid.Row="1" Margin="1,0,0,0"><Run Text="08"/></TextBlock>
<TextBlock x:Name="Hejri" Grid.Row="1" HorizontalAlignment="Right" Width="9.773" Margin="0,0,0,0"><Run Text="۰۱"/></TextBlock>
<TextBlock x:Name="Persian" Margin="1,0,0,0" HorizontalAlignment="Left" Width="10"><Run Text="۰"/></TextBlock>
</Grid>
</DataTemplate>
</Window.Resources>
<Grid Margin="0,10,0,0">
<Grid.DataContext>
<XmlDataProvider x:Name="TeamData" Source="weekdays.xml" XPath="days/day" />
</Grid.DataContext>
<ListView x:Name="TeamsListBox" DockPanel.Dock="Left"
ItemsSource="{Binding}"
ItemTemplate="{StaticResource weekItemTemplate}"
IsSynchronizedWithCurrentItem="True"
Visibility="Visible" SelectionMode="Single" />