Closed freever closed 4 years ago
Thanks @freever ! CSharpForMarkup is now integrated in Xamarin.Forms 4.6 (currently in preview release). It contains a lot of improvements (and quite a few helper renames so be aware of that) so I would encourage you to switch to that.
I already created a helper that does what you need: commit
public static GridLength Stars(double value) => new GridLength(value, GridUnitType.Star);
You can use it like this:
RowDefinitions = Rows.Define (
(Row.ConvertedNumber, Star),
(Row.ConvertButton , Stars (2)))
This will be in the next Xamarin Forms CSharpForMarkup PR which will extend the merged one.
For now you can add the above extension method to your project and add a using static
of the class that contains it.
Thanks I will use that for now
Hi
I am really starting to love this library, and I can't wait for it to be part of Xamarin.Forms. Death to XAML :)
I can't figure out a way to provide a value to GridLength.Star when defining rows and columns. As far as I can tell I can either provide a numberic value, which is used as GridLength.Absolute, or I can provide a GridLength of .Star or .Auto... but I cannot give a numeric value AND a GridLength.
For example, if I want to create a grid with 3 columns, one of which is twice the size of the other two, I would do something like:
Is there a snazzy way of doing this, like an overload that allows:
Thanks!