public override void OnApplyTemplate() { UpdatePositionAndLineExtents(); _popup = GetTemplateChild("PART_Popup") as Popup; base.OnApplyTemplate(); }