So If I have an items control and want to get the canvas in the code behind, what should I do? I can get the itemscontrol, but then what do I do to retrieve the canvas? I have tried
Canvas c1 = ic.FindName("MarkerCanvas") as Canvas;
where ic is the itemscontrol. I have also tried the findname function under the itemscontrol's various templates to little avail. What should I be doing?
<ItemsControl
>
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<Canvas
x:Name="MarkerCanvas"
SnapsToDevicePixels="false"
/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl
>