dotnet / MobileBlazorBindings

Experimental Mobile Blazor Bindings - Build native and hybrid mobile apps with Blazor
MIT License
1.2k stars 174 forks source link

Grid.ColumnDefinitions? #47

Closed tleylan closed 4 years ago

tleylan commented 4 years ago

I'm not experienced with Xamarin so I'm watching a video and trying to apply the lessons. Right off the bat they are using a Grid layout. MBB has a but it doesn't appear to support the Xamarin syntax for Grid.ColumnDefinitions and Grid.ColumnDefinition.

I don't know what to look for a) is the syntax just different or b) there is limited support for grids at the moment or c) something else :-)

Is the basic concept that the Xamarin controls will be mapped into Blazor or that we just use Blazor components at will? Thanks again.

Eilon commented 4 years ago

Hi, the Grid components as well as RowDefinition/ColumnDefinition are indeed supported, but the syntax is a bit different from XAML.

Check out the Weather App walkthrough here: https://docs.microsoft.com/en-us/mobile-blazor-bindings/walkthroughs/weather-app

It contains some info on how to use the Grid, plus it links to the Weather App sample that uses a Grid: https://github.com/xamarin/MobileBlazorBindings/blob/master/samples/MobileBlazorBindingsWeather/MobileBlazorBindingsWeather/MainPage.razor#L7-L122

tleylan commented 4 years ago

Thanks Eilon. I'm working through the video again. I can see there is going to be a learning curve based on the conventions used. I mean your walk-through shows a property named GridUnitType then links to more info for Xamarin and it names the properties Height and Width. It makes sense since these properties accept a GridUnitType, I'll figure it out somehow :-)

Eilon commented 4 years ago

I wrote up a doc on some of the syntax as well as examples. They are now live here: https://docs.microsoft.com/mobile-blazor-bindings/ui/grid-layout

The docs show both the old syntax (Preview 4 and earlier) and the new syntax (Preview 5 and later).