/// <summary> /// Initializes a new instance of the <see cref="MarkdownTextBlock"/> class. /// </summary> public MarkdownTextBlock() { // Set our style. DefaultStyleKey = typeof(MarkdownTextBlock); // Listens for theme changes and updates the rendering. themeListener = new Helpers.ThemeListener(); themeListener.ThemeChanged += ThemeListener_ThemeChanged; // Register for property callbacks that are owned by our parent class. RegisterPropertyChangedCallback(FontSizeProperty, OnPropertyChanged); RegisterPropertyChangedCallback(BackgroundProperty, OnPropertyChanged); RegisterPropertyChangedCallback(BorderBrushProperty, OnPropertyChanged); RegisterPropertyChangedCallback(BorderThicknessProperty, OnPropertyChanged); RegisterPropertyChangedCallback(CharacterSpacingProperty, OnPropertyChanged); RegisterPropertyChangedCallback(FontFamilyProperty, OnPropertyChanged); RegisterPropertyChangedCallback(FontSizeProperty, OnPropertyChanged); RegisterPropertyChangedCallback(FontStretchProperty, OnPropertyChanged); RegisterPropertyChangedCallback(FontStyleProperty, OnPropertyChanged); RegisterPropertyChangedCallback(FontWeightProperty, OnPropertyChanged); RegisterPropertyChangedCallback(ForegroundProperty, OnPropertyChanged); RegisterPropertyChangedCallback(PaddingProperty, OnPropertyChanged); RegisterPropertyChangedCallback(RequestedThemeProperty, OnPropertyChanged); RegisterPropertyChangedCallback(SchemeListProperty, OnPropertyChanged); }
private void ThemeListener_ThemeChanged(Helpers.ThemeListener sender) { RenderMarkdown(); }