Some more suggestions

Nov 30, 2010 at 7:32 AM

1: Spacing inside markup extensions.

Please, add ability to detect and auto-format cases like this:

http://www.copypastecode.com/53637/

Currently, it formats as:

http://www.copypastecode.com/53641/

2: Style setters. Currently, it formats them as 

 <Setter Value="True" Property="IsReadOnly" />

I'd prefer to have more natural order;) 

Thanks!

Nov 30, 2010 at 7:34 AM

Oups, #2 already exists on issue tracker:)

Coordinator
Nov 30, 2010 at 11:41 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Dec 9, 2010 at 1:22 AM

Hi, Sinix:

I have spent several days think about the details of "style markup extension" feature.

The deeper I go, the deeper I got stuck on how to fit this feature in with the existing attribute styling options but still maintain a good readability of the formatted Xaml.

And I have several assumptions formed in my head, let's see if you or anybody else have other opinions:

1. XAML specific markup extensions ({x:*})

e.g., <Style TargetType="{x:Type Xyz}">

I believe no one would like to put this  kind of markup extension into multi-lines, since this is already simple enough for reading.

2. WPF specific markup extensions

a. Element only have 2 attributes (fits into attribute torrence):

<TextBox x:Name="someName" Text="{Binding ...}" />

This is a quite common case, that I also think breaking this binding into lines will make the xaml more complex to read.

b. What if I am using MaxAttributesPerLine = 3

<SomeElement
Property1="..." Property2="..." Property3="{Binding ...}"
...>

Under this case, split the {Binding ...} into multilines would also create an xaml hard to be read.

So what I am stuck now is, we need to define a clear rule on how to format Markup Extension while still make the overall xaml formatting (developer experience) still looks good.

Any thoughts?

Chris

Dec 9, 2010 at 8:30 AM

Hi!

>Any thoughts?

Not much;) All I can invent - the "preserve line breaks inside markup extensions" setting:(

ala "If there's a line break - align the new lines as previous one (with line indent setting added). If no - collapse the spaces"