Frage

How can I force Visual Studio 2013 to indent following code?

<Grid>
    <TextBlock Margin="42"
        Text="yolo"
                        FontSize="42">
    </TextBlock>
</Grid>

Unfortunatelly CONTROL+K CONTROL+D and CONTROL+K CONTROL+F don't work...

I know that I can rewrite it to

<Grid>
    <TextBlock>
        <TextBlock.Margin>42</TextBlock.Margin>
        <TextBlock.FontSize>42</TextBlock.FontSize>
        yolo
    </TextBlock>
</Grid>

but i don't want to do this this way.

Update

I can't install Xaml Styler according to @Mashton's answer, because I've got following error.

War es hilfreich?

Lösung

The only way I know would be to use an extension, such as Xaml Styler, which will break a Xaml onto new lines for each attribute. Other plugins exist, I'm sure, which will give you more control.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top