public override void OnApplyTemplate() { base.OnApplyTemplate(); Dispatcher.BeginInvoke(new Action(() => { _cancelButton = Template?.FindName("PART_CancelButton", this) as Button; TemplateApplied?.Invoke(this, new EventArgs()); }), DispatcherPriority.Loaded); }
private static void OnTemplateApplied(object sender, RoutedEventArgs e) { TemplateApplied?.Invoke(sender, (TemplateAppliedEventArgs)e); }