wpf - best practices for hard-coded sizes in XAML -


I know that in WPF, you want to keep the size of control as flexible as possible so that they can flow and extend their reference On the basis (such as in CSS)

But in most instances, I have many c-coding sizes in this example, like heights:

   & Lt; Column width = "0.5 *" /> & Lt; /Grid.ColumnDefinitions> & Lt; Grid.RowDefinitions & gt; & Lt; RowDefinition Height = "31" /> & Lt; RowDefinition Height = "31" /> & Lt; RowDefinition Height = "31" /> & Lt; /Grid.RowDefinitions>  

Is not a height of "31" being assigned to each line that should not be emulated? Or is there any reason for this? Or it may be that the authors make these examples in the design scene and do not clean hard-coded heights.

Is any of the best practices about Sizain (in relation to using syntax), that people who start with XAML can follow the development of a good habit from the beginning?

Generally, this is the best practice to use a dynamic size within an XAM because as you It is said that the concept of WPF is unpredictable with certain dimensions. In your special example, I do not know what it wants from the author, remember that there are some cases related to hardcode values ​​(perhaps a custom menu bar or a panel that you want to keep continuously at its size). Notation "2 *" means that the value will double from the value of the other columns and thus, the use of star notation in each column is not very useful.

If you are looking for some examples, then you can address them (but if you search on Google for "WPF Star Size" or something that you get to others). Also, if you are looking for a great book about WPF, then I can definitely point you to this one of my favorites, it has been well written, full of colorful examples and Includes every aspect of WPF.


Comments