Issue
I have this code:
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
Can someone tell me how I can represent this using the new shortcut?
<Grid ColumnDefinitions=" ,50">
In particular I am not sure what to put for the first ColumnDefinition
which in my code is currently just a space before the slash.
Related:
Proposal: Simplify Grid Column and Row Definitions #673
Solution
As noted on the Grid Docs page the default value for Width
(or Height
in the case of RowDefinitions
) is *
.
The default value of the RowDefinition.Height property is *. Similarly, the default value of the ColumnDefinition.Width property is *. Therefore, it's not necessary to set these properties in cases where these defaults are acceptable.
(from the first "Important" box on the page at the time of writing)
That means, whenever you don't specify the property explicitly, the value is *
. So when you want to use the short-hand notation you would need to use *
Answered By - Gerald Versluis
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.