Namespaced Binding All on One Line

May 7, 2011 at 12:20 AM

The ComboBox binding attributes are spaced correctly. The Buttons command bindings below it are not?

 

<ComboBox x:Name="cmbClient" Grid.Row="6" Grid.Column="1" Margin="0,4"
                      HorizontalAlignment="Left" DisplayMemberPath="ClientName"
                      ItemsSource="{Binding Clients}"
                      SelectedItem="{Binding SelectedClient,
                                             Mode=TwoWay,
                                             NotifyOnValidationError=True,
                                             ValidatesOnDataErrors=True}"
                      SelectedValuePath="ClientId" />
            <StackPanel Grid.Row="7" Grid.Column="1" Margin="8,0,-2,0" HorizontalAlignment="Right"
                        Orientation="Horizontal" d:LayoutOverrides="Width">
                <Button x:Name="CreateUser" Margin="0,4" cmd:Click.Command="{Binding RegisterUserCommand, Mode=OneWay}" Content="Create" />
                <Button x:Name="Cancel" Margin="0,4" cmd:Click.Command="{Binding RegisterUserCommand, Mode=OneWay}" Content="Cancel" />
            </StackPanel>

I do wish that Bindings had the same multiple elements on one line settings as the normal Atrributes had (my partial preferred sort order is Property, Path, Converter, StringFormat, Mode, Validations)

Adam

 

May 8, 2011 at 10:57 PM

It would be nice if there was a separate attribute tolerance option for the Binding attributes.

 

--theo

 

Coordinator
Jul 30, 2011 at 6:26 PM
Edited Jul 30, 2011 at 6:28 PM
adamhill wrote:

The ComboBox binding attributes are spaced correctly. The Buttons command bindings below it are not?

 

<ComboBox x:Name="cmbClient" Grid.Row="6" Grid.Column="1" Margin="0,4"
                      HorizontalAlignment="Left" DisplayMemberPath="ClientName"
                      ItemsSource="{Binding Clients}"
                      SelectedItem="{Binding SelectedClient,
                                             Mode=TwoWay,
                                             NotifyOnValidationError=True,
                                             ValidatesOnDataErrors=True}"
                      SelectedValuePath="ClientId" />
            <StackPanel Grid.Row="7" Grid.Column="1" Margin="8,0,-2,0" HorizontalAlignment="Right"
                        Orientation="Horizontal" d:LayoutOverrides="Width">
                <Button x:Name="CreateUser" Margin="0,4" cmd:Click.Command="{Binding RegisterUserCommand, Mode=OneWay}" Content="Create" />
                <Button x:Name="Cancel" Margin="0,4" cmd:Click.Command="{Binding RegisterUserCommand, Mode=OneWay}" Content="Cancel" />
            </StackPanel>

I do wish that Bindings had the same multiple elements on one line settings as the normal Atrributes had (my partial preferred sort order is Property, Path, Converter, StringFormat, Mode, Validations)

Adam

 

Hi, Adam:

This is by design.

It looks like your "Attribute tolerance" setting is 4.

The buttons which have no line break in bindings were caused by they do not have enough attributes to trigger the line breaks...

As "Attribute tolerance" has been set to 4, it is meant to instruct styler: given an element having no more than 4 attributes, do not put line breaks between the attributes, :).

Chris