开发者

How to order WPF tag attributes consistently

开发者 https://www.devze.com 2022-12-13 00:37 出处:网络
While working with WPF I switch between XAML and the designer. This causes the attributes on each element to be ordered differently and makes the code harder to read unless I go though and reorder eve

While working with WPF I switch between XAML and the designer. This causes the attributes on each element to be ordered differently and makes the code harder to read unless I go though and reorder everything manually.

Is there an easier way开发者_高级运维 to do this?

<TextBox Name="txtFirstName" Text="{Binding Path=FirstName, Mode=Default}" Grid.Column="1" Margin="6,2,31,11" Grid.Row="5" />

<TextBox Grid.RowSpan="2" Text="{Binding Path=LastName, Mode=Default}" Margin="6,0,31,4" Name="txtLastName" Grid.Column="1" Height="25" Grid.Row="3" VerticalAlignment="Bottom" />


I use the XAML Styler extension to format my XAML files. It automatically sorts attributes by a configurable priority and does some other nice formatting for you.

How to order WPF tag attributes consistently


Take a look at Visual Studio's Document Outline window (in View - Other Windows). It shows the document structure as a tree and allows you to quickly position into any element, so maybe it will be useful for you.

0

精彩评论

暂无评论...
验证码 换一张
取 消