diff --git a/samples/ThirdPartyControlsSample/Elements/AlohaKit/Avatar.generated.cs b/samples/ThirdPartyControlsSample/Elements/AlohaKit/Avatar.generated.cs index 456598a8..57c60b82 100644 --- a/samples/ThirdPartyControlsSample/Elements/AlohaKit/Avatar.generated.cs +++ b/samples/ThirdPartyControlsSample/Elements/AlohaKit/Avatar.generated.cs @@ -8,8 +8,10 @@ using AC = AlohaKit.Controls; using BlazorBindings.Core; using BlazorBindings.Maui.Elements; +using BlazorBindings.Maui.Elements.Handlers; using MC = Microsoft.Maui.Controls; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Rendering; using Microsoft.Maui.Graphics; using System.Threading.Tasks; @@ -19,13 +21,19 @@ public partial class Avatar : BlazorBindings.Maui.Elements.GraphicsView { static Avatar() { + ElementHandlerRegistry.RegisterPropertyContentHandler(nameof(Background), + (renderer, parent, component) => new ContentPropertyHandler((x, value) => x.Background = (MC.Brush)value)); + ElementHandlerRegistry.RegisterPropertyContentHandler(nameof(Fill), + (renderer, parent, component) => new ContentPropertyHandler((x, value) => x.Fill = (MC.Brush)value)); RegisterAdditionalHandlers(); } [Parameter] public AC.AvatarSize? AvatarSize { get; set; } + [Parameter] public Color FillColor { get; set; } [Parameter] public string Name { get; set; } [Parameter] public AC.AvatarDrawable PersonaDrawable { get; set; } [Parameter] public Color TextColor { get; set; } + [Parameter] public RenderFragment Fill { get; set; } public new AC.Avatar NativeControl => (AC.Avatar)((Element)this).NativeControl; @@ -42,6 +50,13 @@ protected override void HandleParameter(string name, object value) NativeControl.AvatarSize = AvatarSize ?? (AC.AvatarSize)AC.Avatar.AvatarSizeProperty.DefaultValue; } break; + case nameof(FillColor): + if (!Equals(FillColor, value)) + { + FillColor = (Color)value; + NativeControl.Fill = FillColor; + } + break; case nameof(Name): if (!Equals(Name, value)) { @@ -63,6 +78,12 @@ protected override void HandleParameter(string name, object value) NativeControl.TextColor = TextColor; } break; + case nameof(Background): + Background = (RenderFragment)value; + break; + case nameof(Fill): + Fill = (RenderFragment)value; + break; default: base.HandleParameter(name, value); @@ -70,6 +91,13 @@ protected override void HandleParameter(string name, object value) } } + protected override void RenderAdditionalElementContent(RenderTreeBuilder builder, ref int sequence) + { + base.RenderAdditionalElementContent(builder, ref sequence); + RenderTreeBuilderHelper.AddContentProperty(builder, sequence++, typeof(Avatar), Background); + RenderTreeBuilderHelper.AddContentProperty(builder, sequence++, typeof(Avatar), Fill); + } + static partial void RegisterAdditionalHandlers(); } } diff --git a/samples/ThirdPartyControlsSample/Elements/AlohaKit/Button.generated.cs b/samples/ThirdPartyControlsSample/Elements/AlohaKit/Button.generated.cs index 2f4508be..7f7c5f94 100644 --- a/samples/ThirdPartyControlsSample/Elements/AlohaKit/Button.generated.cs +++ b/samples/ThirdPartyControlsSample/Elements/AlohaKit/Button.generated.cs @@ -8,8 +8,10 @@ using AC = AlohaKit.Controls; using BlazorBindings.Core; using BlazorBindings.Maui.Elements; +using BlazorBindings.Maui.Elements.Handlers; using MC = Microsoft.Maui.Controls; using Microsoft.AspNetCore.Components; +using Microsoft.AspNetCore.Components.Rendering; using Microsoft.Maui; using Microsoft.Maui.Graphics; using System; @@ -21,6 +23,10 @@ public partial class Button : BlazorBindings.Maui.Elements.GraphicsView { static Button() { + ElementHandlerRegistry.RegisterPropertyContentHandler