My name is Edward Tanguay. I'm an American software and web developer living and working in Berlin, Germany.
SILVERLIGHT CODE EXAMPLE created on Wednesday, June 30, 2010 permalink
How to create a TextBlock that has various font formatting in code behind
When you create a TextBlock, you can assign it a text and then assign formatting only to the whole text, e.g. the whole TextBlock can be one color. If you want different parts of the TextBlock.Text to be various colors and have various formatting (e.g. italic/bold), you can create as many Run elements as you need and add them to the TextBlock with Inlines collection.
<UserControl x:Class="TestRun2343.MainPage"
    <StackPanel HorizontalAlignment="Left" Margin="10">
        <ContentControl Content="{Binding MainContent}"/>

Code Behind:
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Media;

namespace TestRun2343
    public partial class MainPage : UserControl, INotifyPropertyChanged
        #region ViewModelProperty: MainContent .
        private object _mainContent;
        public object MainContent
                return _mainContent;

                _mainContent = value;
        #endregion .

        public MainPage()
            : base()
            DataContext = this;

            TextBlock tb = new TextBlock();
            tb.FontSize = 14;
            tb.FontFamily = new FontFamily("Courier");

            Run runLabel = new Run();
            runLabel.Foreground = new SolidColorBrush(Colors.Brown);
            runLabel.Text = "Test 1: ";

            Run runContent = new Run();
            runContent.Foreground = new SolidColorBrush(Colors.Black);
            runContent.FontStyle = FontStyles.Italic;
            runContent.Text = "This is the first test.";


            MainContent = tb;

        #region INotifiedProperty Block .
        public event PropertyChangedEventHandler PropertyChanged;

        protected void OnPropertyChanged(string propertyName)
            PropertyChangedEventHandler handler = PropertyChanged;

            if (handler != null)
                handler(this, new PropertyChangedEventArgs(propertyName));
        #endregion .
need markup?