Inside this custom control's control template
<ControlTemplate TargetType="{x:Type local:CustomLineGraph}">
<StackPanel Orientation="Vertical">
<Canvas x:name"myCanvas"></Canvas>
<Border Background="#FF0000"
BorderBrush="Red"
BorderThickness="5">
</Border>
</StackPanel>
</ControlTemplate>
How can I access the Canvas
from the class
public class CustomLineGraph : Control
{
myCanvas.AddChild(obj);
}
x:name doesn't work.