This, I hope, will be a very simple answer, I just do not see the notorious tree for the trees that I think.
I have a DataGridCell style in which I want to associate the contents of a cell with the original image property, here is the XAML that I am currently using:
<Style x:Key="DataGridImageCellStyle" TargetType="{x:Type toolkit:DataGridCell}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderBrush" Value="Transparent" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type toolkit:DataGridCell}"> <Border Background="Transparent" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" SnapsToDevicePixels="True"> <Image Source="{Binding RelativeSource={RelativeSource AncestorType=toolkit:DataGridCell}, Path=Content}" /> </Border> </ControlTemplate> </Setter.Value> </Setter> </Style>
Please note that at the moment I am linking the image source to the content .. which does not work, I also tried a value that did not work!
So my question is nice and simple .. What is the correct binding used to get the contents of the cell in the original property of this image?
Thanks in advance!
Pete
source share