private static void OnPropertyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
{
var textBlock = sender as GameMessageTextBlock;
if (textBlock == null) return;
if (textBlock.Inlines.FirstInline != null) textBlock.Inlines.Remove(textBlock.Inlines.FirstInline);
var b = Gui.ChatControl.GameMessageToBlock(textBlock.GameMessage) as System.Windows.Documents.Section;
if (b == null) return;
//textBlock.Inlines.Add(new Run("♦ ")
// {
// FontSize = 8
// });
//new BulletDecorator()
//{
// Bullet =
// new Image()
// {
// Source =
// new BitmapImage(new Uri("pack://application:,,,/OCTGN;component/Resources/statusOffline.png")),
// Stretch = Stretch.Uniform,
// Width = 12,
// Height=8,
// VerticalAlignment = VerticalAlignment.Center,
// Margin = new Thickness(0, 0, 3, 0)
// },
// VerticalAlignment = VerticalAlignment.Center,
// Width = 8,
// Height = 8
//});
foreach (var block in b.Blocks.OfType<System.Windows.Documents.Paragraph>().ToArray())
{
foreach (var i in block.Inlines.ToArray())
{
textBlock.Inlines.Add(i);
}
}
//textBlock.Inlines.Add(
//new BulletDecorator()
//{
// Bullet =
// new Image()
// {
// Source =
// new BitmapImage(new Uri("pack://application:,,,/OCTGN;component/Resources/orangebullet.png")),
// Stretch = Stretch.Uniform,
// Width = 8,
// VerticalAlignment = VerticalAlignment.Center,
// Margin = new Thickness(3, 0, 0, 0)
// },
// VerticalAlignment = VerticalAlignment.Center,
// Width = 8,
// Height = 8
//});
textBlock.Margin = new Thickness(10, 0, 10, 0);
textBlock.VerticalAlignment = VerticalAlignment.Center;
//textBlock.Inlines.Add(Octgn.Play.Gui.ChatControl.GameMessageToInline(textBlock.GameMessage));
}