Answers

Maybe because DynamicRowDefinition has a protected setter, try to change it to public (or internal if you insist on not using public for any reason)? protected setter means only the class and its children can set the value, the XAML page can't do it.

@Amar_Bait said:
Maybe because DynamicRowDefinition has a protected setter, try to change it to public (or internal if you insist on not using public for any reason)? protected setter means only the class and its children can set the value, the XAML page can't do it.

No, I tried it, but it's not helped !!
I am changing not the original bindable property, but its own property Height ...

Because you are only registering for the SizeChanged event in the default value creator. That block of code is used to create the default value for when you do not set the property yourself. When you create a DynamicRowDefinition object in your XAML you are throwing away that default value. If you register for the event in your XAML I can't guarantee it will fire for your initial setting of the height, but it should if you change it later.

@Amar_Bait said:
OnDynamicRowDefinitionPropertyChanged should trigger, but the method is empty, try inserting the same code in it as defaultValueCreator. Also I insist you should make your property setter public.

As @JoeManke and I told you in this comment, when a property changes, Xamarin.Forms calls OnDynamicRowDefinitionPropertyChanged, which is empty in your code. Put a breakpoint in that method and you will see that it will get called. Put any logic you need there.

Also you are not really clear in explaining your problem. Sometimes you say you need to put XAML inside, sometimes that the Height property is not set... At least try what is suggested here (by developers who have lot more experience than you) and tell us what you got. Also how do you know the Height property is not 50? (show code how you retrieve the value)

@Amar_Bait said:
As @JoeManke and I told you in this comment, when a property changes, Xamarin.Forms calls OnDynamicRowDefinitionPropertyChanged, which is empty in your code. Put a breakpoint in that method and you will see that it will get called. Put any logic you need there.

Also you are not really clear in explaining your problem. Sometimes you say you need to put XAML inside, sometimes that the Height property is not set... At least try what is suggested here (by developers who have lot more experience than you) and tell us what you got. Also how do you know the Height property is not 50? (show code how you retrieve the value)

Because how that's XAML (and XML in general) works. Since your property is of a complex type, you should write XAML like this. Now if you're only interested in the Height property, then why don't you make the property of type double instead of RowDefinition? Like that it will be even simpler in XAML:

@Amar_Bait said:
Because how that's XAML (and XML in general) works. Since your property is of a complex type, you should write XAML like this. Now if you're only interested in the Height property, then why don't you make the property of type double instead of RowDefinition? Like that it will be even simpler in XAML:

&lt; utilscontrols:DynamicGrid DynamicRowHeight="50" /&gt;

Thank you, Amar_Bait, for support !!

According the your explanation I got that when I am doing something like this:

<utilscontrols:DynamicGrid.DynamicRowDefinition Height="50" />

I specify that I create object of type DynamicRowDefinition and set Height="50" to it
Am I right ?
And if yes, why in such case it is not an error during compilation ?

The following code does not work for me, because it creates a new instance of DynamicGrid:

In XAML, however, this syntax is very special. One of the rules for property elements is that nothing else can appear in the Label.TextColor tag. The value of the property is always defined as content between the property-element start and
end tags.

I agree that the XAML compiler should throw an exception saying clearly that nothing should appear in a complex property element tag.

The following code does not work for me, because it creates a new instance of DynamicGrid:

<utilscontrols:DynamicGrid DynamicRowHeight="50" />

What I meant by DynamicRowHeight it to create new property called DynamicRowHeight of type GridLength, instead of DynamicRowDefinition of type RowDefinition, if you only need to have a Height property...

If you explain us what you're trying to do, I think we could probably find a better and less complicated way to do it than your solution. If you're trying to build a Grid with dynamic Row heights than you can use normal RowDefinition with its Height property set to "Auto", it will resize itself automatically to its child size. Also RowDefinition.Height property is a bindable property itself, so you can bind it to any property you want, then you just update the property and the Height will be updated accordingly.

@Amar_Bait said:
If you explain us what you're trying to do, I think we could probably find a better and less complicated way to do it than your solution. If you're trying to build a Grid with dynamic Row heights than you can use normal RowDefinition with its Height property set to "Auto", it will resize itself automatically to its child size. Also RowDefinition.Height property is a bindable property itself, so you can bind it to any property you want, then you just update the property and the Height will be updated accordingly.