AlgoliaSearch.HTMLBinding.OnHighlightBrushChangedCallback C# (CSharp) Method

OnHighlightBrushChangedCallback() private static method

private static OnHighlightBrushChangedCallback ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void
d Windows.UI.Xaml.DependencyObject
e Windows.UI.Xaml.DependencyPropertyChangedEventArgs
return void
        private static void OnHighlightBrushChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            TextBlock textBlock = d as TextBlock;
            if (textBlock == null)
            {
                return;
            }

            Brush brush = GetHighlightBrush(textBlock);

            for (int i = 0; i < textBlock.Inlines.Count; i += 2)
            {
                textBlock.Inlines[i].Foreground = brush;
            }
        }