Tell me, is it possible that Grid.RowDefinition , which has Height - Auto , somehow would not have seen this or that element, that is, would collapse just as if it were empty? But when other elements appear, then it will already display the invisible one along with them.
Gridto simply ignore some elements. I know very well that it would be possible to change the visibility from the code, or to write some converter, but I hope for a more elegant method) - Arthur EdgarovRowDefinitionthrough the converter (for example in this way ), or you canRowDefinitionall elements of this row to some Border / Grid or something like that and setVisibility="Collapsed". This is just a couple of lines of code and I don’t think that this is some kind of crutch, quite a good way. Well, the alternative to all this is to write your RowDefinition . You decide ... - EvgeniyZUserControl, and the logic there is not very simple, so doing something in the code is perfectly acceptable. Another thing is that this particular task really should be solved from XAML, I think so. For your better understanding - we are talking aboutTextBlocks, which are in the lines, of which - 24, on a line for every hour of the day. Well, if there are no elements in this line (events, in the context of my control), then there is no sense to display it - Arthur Edgarov 10:39 pm