I am trying to overlay an image on my BoardSquares but when trying to specify a Source on my Image it says The member "Source" is not recognized or is not accessible. Any idea what I could be doing wrong? P.S I omitted the DataTemplate Triggers but they're there.
<ItemsControl ItemsSource="{Binding BoardGUI.BoardSquares}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <UniformGrid Rows="10" Columns="10"/> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Button x:Name="Square" Command="{Binding DataContext.BoardGUI.SquareClickCommand, RelativeSource={RelativeSource AncestorType=ItemsControl}}" CommandParameter="{Binding}"> <Button.Template> <ControlTemplate TargetType="Button"> <Grid Background="{TemplateBinding Background}"> <Image Source="{TemplateBinding Source}"/> </Grid> </ControlTemplate> </Button.Template> </Button> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl>
{TemplateBinding Source}won't work. What is thatSource?