private void Element_Loaded(object sender, RoutedEventArgs e) { ((FrameworkElement)sender).Loaded -= Element_Loaded; this.Storyboard = AdornedElement .FindLogicalParents <Storyboard>() .FirstOrDefault(); OnLoaded((FrameworkElement)AdornedElement); RendererLoaded?.Invoke(this, e); }
private void Element_Loaded(object sender, RoutedEventArgs e) { var element = sender as FrameworkElement; if (!element.IsVisible) { return; } element.Loaded -= Element_Loaded; this.Storyboard = AdornedElement .FindLogicalParents <Storyboard>() .FirstOrDefault(); OnLoaded((FrameworkElement)AdornedElement); RendererLoaded?.Invoke(this, e); }