@@ -346,20 +346,50 @@ public static T OnCompleted<T>(this T self, Action<T> action)
346
346
}
347
347
348
348
349
+ public static T AlignText < T > ( this T self , TextAlignment vertical , TextAlignment horizontal )
350
+ where T : Editor
351
+ {
352
+ self . SetValue ( Editor . VerticalTextAlignmentProperty , vertical ) ;
353
+ self . SetValue ( Editor . HorizontalTextAlignmentProperty , horizontal ) ;
354
+ return self ;
355
+ }
356
+
357
+ public static SettersContext < T > AlignText < T > ( this SettersContext < T > self , TextAlignment vertical , TextAlignment horizontal )
358
+ where T : Editor
359
+ {
360
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = vertical } ) ;
361
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = horizontal } ) ;
362
+ return self ;
363
+ }
364
+
349
365
public static T TextCenterHorizontal < T > ( this T self )
350
366
where T : Editor
351
367
{
352
368
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Center ) ;
353
369
return self ;
354
370
}
355
371
372
+ public static SettersContext < T > TextCenterHorizontal < T > ( this SettersContext < T > self )
373
+ where T : Editor
374
+ {
375
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
376
+ return self ;
377
+ }
378
+
356
379
public static T TextCenterVertical < T > ( this T self )
357
380
where T : Editor
358
381
{
359
382
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Center ) ;
360
383
return self ;
361
384
}
362
385
386
+ public static SettersContext < T > TextCenterVertical < T > ( this SettersContext < T > self )
387
+ where T : Editor
388
+ {
389
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
390
+ return self ;
391
+ }
392
+
363
393
public static T TextCenter < T > ( this T self )
364
394
where T : Editor
365
395
{
@@ -368,112 +398,195 @@ public static T TextCenter<T>(this T self)
368
398
return self ;
369
399
}
370
400
401
+ public static SettersContext < T > TextCenter < T > ( this SettersContext < T > self )
402
+ where T : Editor
403
+ {
404
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
405
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
406
+ return self ;
407
+ }
408
+
371
409
public static T TextTop < T > ( this T self )
372
410
where T : Editor
373
411
{
374
412
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Start ) ;
375
413
return self ;
376
414
}
377
415
416
+ public static SettersContext < T > TextTop < T > ( this SettersContext < T > self )
417
+ where T : Editor
418
+ {
419
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
420
+ return self ;
421
+ }
422
+
378
423
public static T TextBottom < T > ( this T self )
379
- where T : Editor , Microsoft . Maui . ITextAlignment
424
+ where T : Editor
380
425
{
381
426
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . End ) ;
382
427
return self ;
383
428
}
384
429
385
- public static T TextTopStart < T > ( this T self )
430
+ public static SettersContext < T > TextBottom < T > ( this SettersContext < T > self )
431
+ where T : Editor
432
+ {
433
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . End } ) ;
434
+ return self ;
435
+ }
436
+
437
+ public static T TextTopLeft < T > ( this T self )
386
438
where T : Editor
387
439
{
388
440
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Start ) ;
389
441
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Start ) ;
390
442
return self ;
391
443
}
392
444
393
- public static T TextBottomStart < T > ( this T self )
445
+ public static SettersContext < T > TextTopLeft < T > ( this SettersContext < T > self )
446
+ where T : Editor
447
+ {
448
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
449
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
450
+ return self ;
451
+ }
452
+
453
+ public static T TextBottomLeft < T > ( this T self )
394
454
where T : Editor
395
455
{
396
456
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . End ) ;
397
457
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Start ) ;
398
458
return self ;
399
459
}
400
460
401
- public static T TextTopCenterH < T > ( this T self )
461
+ public static SettersContext < T > TextBottomLeft < T > ( this SettersContext < T > self )
462
+ where T : Editor
463
+ {
464
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . End } ) ;
465
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
466
+ return self ;
467
+ }
468
+
469
+ public static T TextTopCenter < T > ( this T self )
402
470
where T : Editor
403
471
{
404
472
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Start ) ;
405
473
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Center ) ;
406
474
return self ;
407
475
}
408
476
409
- public static T TextBottomCenterH < T > ( this T self )
477
+ public static SettersContext < T > TextTopCenter < T > ( this SettersContext < T > self )
478
+ where T : Editor
479
+ {
480
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
481
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
482
+ return self ;
483
+ }
484
+
485
+ public static T TextBottomCenter < T > ( this T self )
410
486
where T : Editor
411
487
{
412
488
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . End ) ;
413
489
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Center ) ;
414
490
return self ;
415
491
}
416
492
417
- public static T TextCenterVEnd < T > ( this T self )
493
+ public static SettersContext < T > TextBottomCenter < T > ( this SettersContext < T > self )
418
494
where T : Editor
419
495
{
420
- self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Start ) ;
421
- self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . End ) ;
496
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . End } ) ;
497
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
422
498
return self ;
423
499
}
424
500
425
- public static T TextCenterVStart < T > ( this T self )
501
+ public static T TextCenterRight < T > ( this T self )
426
502
where T : Editor
427
503
{
428
- self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . End ) ;
504
+ self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Center ) ;
429
505
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . End ) ;
430
506
return self ;
431
507
}
432
508
433
- public static T AlignText < T > ( this T self , TextAlignment vertical , TextAlignment horizontal )
509
+ public static SettersContext < T > TextCenterRight < T > ( this SettersContext < T > self )
434
510
where T : Editor
435
511
{
436
- self . SetValue ( Editor . VerticalTextAlignmentProperty , vertical ) ;
437
- self . SetValue ( Editor . HorizontalTextAlignmentProperty , horizontal ) ;
512
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
513
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . End } ) ;
438
514
return self ;
439
515
}
440
516
441
- public static SettersContext < T > AlignText < T > ( this SettersContext < T > self , TextAlignment vertical , TextAlignment horizontal )
517
+ public static T TextCenterLeft < T > ( this T self )
442
518
where T : Editor
443
519
{
444
- self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = vertical } ) ;
445
- self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = horizontal } ) ;
520
+ self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Center ) ;
521
+ self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Start ) ;
522
+ return self ;
523
+ }
524
+
525
+ public static SettersContext < T > TextCenterLeft < T > ( this SettersContext < T > self )
526
+ where T : Editor
527
+ {
528
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Center } ) ;
529
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
446
530
return self ;
447
531
}
448
532
449
- public static T TextTopEnd < T > ( this T self )
533
+ public static T TextTopRight < T > ( this T self )
450
534
where T : Editor
451
535
{
452
536
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . Start ) ;
453
537
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . End ) ;
454
538
return self ;
455
539
}
456
540
457
- public static T TextBottomEnd < T > ( this T self )
541
+ public static SettersContext < T > TextTopRight < T > ( this SettersContext < T > self )
542
+ where T : Editor
543
+ {
544
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
545
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . End } ) ;
546
+ return self ;
547
+ }
548
+
549
+ public static T TextBottomRight < T > ( this T self )
458
550
where T : Editor
459
551
{
460
552
self . SetValue ( Editor . VerticalTextAlignmentProperty , TextAlignment . End ) ;
461
553
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . End ) ;
462
554
return self ;
463
555
}
464
556
465
- public static T TextStart < T > ( this T self )
557
+ public static SettersContext < T > TextBottomRight < T > ( this SettersContext < T > self )
558
+ where T : Editor
559
+ {
560
+ self . XamlSetters . Add ( new Setter { Property = Editor . VerticalTextAlignmentProperty , Value = TextAlignment . End } ) ;
561
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . End } ) ;
562
+ return self ;
563
+ }
564
+
565
+ public static T TextLeft < T > ( this T self )
466
566
where T : Editor
467
567
{
468
568
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . Start ) ;
469
569
return self ;
470
570
}
471
571
472
- public static T TextEnd < T > ( this T self )
572
+ public static SettersContext < T > TextLeft < T > ( this SettersContext < T > self )
573
+ where T : Editor
574
+ {
575
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . Start } ) ;
576
+ return self ;
577
+ }
578
+
579
+ public static T TextRight < T > ( this T self )
473
580
where T : Editor
474
581
{
475
582
self . SetValue ( Editor . HorizontalTextAlignmentProperty , TextAlignment . End ) ;
476
583
return self ;
477
584
}
478
585
586
+ public static SettersContext < T > TextRight < T > ( this SettersContext < T > self )
587
+ where T : Editor
588
+ {
589
+ self . XamlSetters . Add ( new Setter { Property = Editor . HorizontalTextAlignmentProperty , Value = TextAlignment . End } ) ;
590
+ return self ;
591
+ }
479
592
}
0 commit comments