public TextBlock() { _painter = new TextPainter(); this.GetObservable(FontFamilyProperty).Subscribe(UpdateTypeface); this.GetObservable(FontSizeProperty).Subscribe(v => _painter.FontSize = (float)v); this.GetObservable(ForegroundProperty).Subscribe( v => _painter.TextColor = (v as ISolidColorBrush)?.Color ?? default); this.GetObservable(TextProperty).Subscribe(v => _painter.Source = TextSource.FromLaTeX(v)); }