-2

The syntax described here doesn't work for me. I used <!-- language: lang-xaml --> and <!-- language: lang-c# -->. Nothing works.

Here's what I wrote as an answer to some question.

XAML
<!-- language: lang-xaml -->

    <RadioButton>
        <TextBlock Text="Sample" 
                   TextWrapping="Wrap"/>
    </RadioButton>

C#
<!-- language: lang-c# -->

    RadioButton rb = new RadioButton();
    rb.Content = new TextBlock()
    {
        Text = "Sample",
        TextWrapping = TextWrapping.Wrap,
    };

And here's how it looks like (below). Everything is black. Why?

XAML

<RadioButton>
    <TextBlock Text="This is very long text that I want to wrap. Is it long enough?" 
               TextWrapping="Wrap"/>
</RadioButton>

C#

RadioButton rb = new RadioButton();
rb.Content = new TextBlock()
{
    Text = "This is very long text that I want to wrap. Is it long enough?",
    TextWrapping = TextWrapping.Wrap,
};
0

1 Answer 1

2

You need to put a newline before the comment too, otherwise it is just part of the preceding paragraph.

XAML

<!-- language: lang-xaml -->

    <RadioButton>
        <TextBlock Text="Sample" 
                   TextWrapping="Wrap"/>
    </RadioButton>

C#

<!-- language: lang-c# -->

    RadioButton rb = new RadioButton();
    rb.Content = new TextBlock()
    {
        Text = "Sample",
        TextWrapping = TextWrapping.Wrap,
    };

Not the answer you're looking for? Browse other questions tagged .