@@ -269,9 +269,125 @@ module GridPage =
269269 .gridColumn( 3 )
270270 .horizontalAlignment( HorizontalAlignment.Stretch)
271271 }
272+ |> _. showGridLines( true )
273+ |> _. rowSpacing( 10. )
274+ |> _. columnSpacing( 10. )
275+
272276 }
273277 |> _. isSharedSizeScope( true )
274278
279+ let gridSpacingView () =
280+ VStack( spacing = 20. ) {
281+ TextBlock( " Grid with Spacing Examples" )
282+ .fontWeight( FontWeight.Bold)
283+ .fontSize( 18. )
284+
285+ TextBlock( " Basic Grid with Spacing (2x2)" )
286+ .fontWeight( FontWeight.Bold)
287+ .fontSize( 16. )
288+ .margin( 0. , 0. , 0. , 5. )
289+
290+ ( Grid( coldefs = [ Pixel( 100 ); Pixel( 100 ) ], rowdefs = [ Pixel( 100 ); Pixel( 100 ) ]) {
291+ Border()
292+ .background( SolidColorBrush( Colors.LightBlue))
293+ .gridRow( 0 )
294+ .gridColumn( 0 )
295+
296+ Border()
297+ .background( SolidColorBrush( Colors.LightGreen))
298+ .gridRow( 0 )
299+ .gridColumn( 1 )
300+
301+ Border()
302+ .background( SolidColorBrush( Colors.LightPink))
303+ .gridRow( 1 )
304+ .gridColumn( 0 )
305+
306+ Border()
307+ .background( SolidColorBrush( Colors.LightYellow))
308+ .gridRow( 1 )
309+ .gridColumn( 1 )
310+ })
311+ .rowSpacing( 10. )
312+ .columnSpacing( 10. )
313+ .showGridLines( true )
314+ .margin( 0. , 0. , 0. , 20. )
315+
316+ TextBlock( " Complex Grid with Mixed Sizing" )
317+ .fontWeight( FontWeight.Bold)
318+ .fontSize( 16. )
319+ .margin( 0. , 0. , 0. , 5. )
320+
321+ ( Grid( coldefs = [ Pixel( 50 ); Star; Stars( 2 ); Auto ], rowdefs = [ Pixel( 50 ); Star; Stars( 2 ); Auto ]) {
322+ Border()
323+ .background( SolidColorBrush( Colors.LightBlue))
324+ .gridRow( 0 )
325+ .gridColumn( 0 )
326+
327+ Border()
328+ .background( SolidColorBrush( Colors.LightGreen))
329+ .gridRow( 1 )
330+ .gridColumn( 1 )
331+
332+ Border()
333+ .background( SolidColorBrush( Colors.LightPink))
334+ .gridRow( 2 )
335+ .gridColumn( 2 )
336+
337+ Border()
338+ .background( SolidColorBrush( Colors.LightYellow))
339+ .width( 30. )
340+ .height( 30. )
341+ .gridRow( 3 )
342+ .gridColumn( 3 )
343+ })
344+ .rowSpacing( 10. )
345+ .columnSpacing( 10. )
346+ .width( 200. )
347+ .height( 200. )
348+ .showGridLines( true )
349+ .margin( 0. , 0. , 0. , 20. )
350+
351+ TextBlock( " Grid with Spacing Overflow" )
352+ .fontWeight( FontWeight.Bold)
353+ .fontSize( 16. )
354+ .margin( 0. , 0. , 0. , 5. )
355+
356+ ( Grid( coldefs = [ Pixel( 30 ); Star; Star; Auto ], rowdefs = [ Pixel( 30 ); Star; Star; Auto ]) {
357+ Border()
358+ .background( SolidColorBrush( Colors.LightBlue))
359+ .gridRow( 0 )
360+ .gridColumn( 0 )
361+
362+ Border()
363+ .background( SolidColorBrush( Colors.LightGreen))
364+ .gridRow( 1 )
365+ .gridColumn( 1 )
366+
367+ Border()
368+ .background( SolidColorBrush( Colors.LightPink))
369+ .gridRow( 2 )
370+ .gridColumn( 2 )
371+
372+ Border()
373+ .background( SolidColorBrush( Colors.LightYellow))
374+ .width( 30. )
375+ .height( 30. )
376+ .gridRow( 3 )
377+ .gridColumn( 3 )
378+ })
379+ .rowSpacing( 20. )
380+ .columnSpacing( 20. )
381+ .width( 100. )
382+ .height( 100. )
383+ .showGridLines( true )
384+ .margin( 0. , 0. , 0. , 20. )
385+
386+ TextBlock( " Notice how excessive spacing can cause interior cells to have 0 width/height." )
387+ .textWrapping( TextWrapping.Wrap)
388+ .opacity( 0.8 )
389+ }
390+
275391 let view () =
276392 Component( " GridPage" ) {
277393 let! model = Context.Mvu program
@@ -280,6 +396,8 @@ module GridPage =
280396 TabItem( " Grids" , gridView1())
281397
282398 TabItem( " SharedSizeGroup" , gridView2 model.People)
399+
400+ TabItem( " Grid Spacing" , gridSpacingView())
283401 })
284402 .margin( 0. , 16. )
285403
0 commit comments