AerialForWindows.ScreenSaverWindow.MediaElementOnMediaFailed C# (CSharp) Метод

MediaElementOnMediaFailed() приватный Метод

private MediaElementOnMediaFailed ( object sender, System.Windows.ExceptionRoutedEventArgs args ) : void
sender object
args System.Windows.ExceptionRoutedEventArgs
Результат void
        private void MediaElementOnMediaFailed(object sender, ExceptionRoutedEventArgs args)
        {
            if (_textBlockError == null) {
                _textBlockError = new TextBlock {
                    Foreground = Brushes.White,
                    FontSize = 14,
                    Margin = new Thickness(2),
                    HorizontalAlignment = HorizontalAlignment.Left,
                    VerticalAlignment = VerticalAlignment.Top,
                    TextWrapping = TextWrapping.WrapWithOverflow,
                    Effect = new DropShadowEffect {
                        ShadowDepth = 0,
                        Color = Colors.Black,
                        BlurRadius = 8
                    }
                };
                ((Grid) Content).Children.Add(_textBlockError);
            }

            _textBlockError.Text = $"Playing {_mediaElement.Source} failed.\n{args.ErrorException.Message}";
        }