public override void OnApplyTemplate() { base.OnApplyTemplate(); _image = (StaticImage)GetTemplateChild("ImageContainer"); _surface = (DrawingSurface)GetTemplateChild("SurfaceContainer"); CreateIfReady(); }