public PendingWindow(string message, string caption, bool canCancel, object cancelButtonContent) { InitializeComponent(); _pendingBoxXControl = new PendingBoxXControl(message, caption, canCancel, cancelButtonContent); _pendingBoxXControl.Cancel += PendingBoxXControl_Cancel; Content = _pendingBoxXControl; }
public override void OnApplyTemplate() { base.OnApplyTemplate(); Dispatcher.BeginInvoke(new Action(() => { _control = VisualTreeHelper.GetChild(this, 0) as PendingBoxXControl; _control.TemplateApplied += Control_TemplateApplied; }), DispatcherPriority.Loaded); }