private static void OnInlineCollectionPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var textblock = d as TextBlock;
var newValue = e.NewValue as IEnumerable<Inline>;
if (textblock != null && newValue != null)
{
textblock.Inlines.Clear();
foreach (var line in newValue)
{
textblock.Inlines.Add(line);
}
}
}