Click here to Skip to main content
16,022,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
Hi people.
I was wondering is there any solution for breaking a long line of code into multiple lines?
For example I have this:
XML
<Grid x:Name="MyGrid" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto"/>


How can I break lines and have this:
XML
<Grid x:Name="MyGrid"
      HorizontalAlignment="Stretch"
      VerticalAlignment="Stretch"
      Width="Auto"
      Height="Auto"/>


I know that I can do it with hand by hitting Enter. I am looking for an immediate way by the system.

What I have tried:

I searched on internet a lot, but I didn't find any idea.
Posted
Updated 29-May-24 22:11pm
v3

1 solution

Open up the Tools menu and select Options. Look for Text Editor, inside this, there is a XAML option. Under the XAML option, look for Formatting. This has a Spacing entry, select Position each attribute on a separate line.
 
Share this answer
 
Comments
Mike Hankey 30-May-24 7:26am    
Thanks Pete...old dog, new tricks. :)
Learned something new.
Pete O'Hanlon 30-May-24 8:07am    
My pleasure Mike.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900