public override void OnApplyTemplate() { btn = GetTemplateChild("PART_CloseButton") as PushButton; //Closed Event to the Button btn.Click += Closed_Click; }