-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ComponentGenerator: generate all elements from assembly (#136)
- Loading branch information
1 parent
67f2792
commit bba5949
Showing
24 changed files
with
2,312 additions
and
30 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
samples/ThirdPartyControlsSample/Elements/Material.Components/MDBaseLazyView.generated.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// <auto-generated> | ||
// This code was generated by a BlazorBindings.Maui component generator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
|
||
using BlazorBindings.Core; | ||
using BlazorBindings.Maui.Elements; | ||
using MC = Microsoft.Maui.Controls; | ||
using MCM = Material.Components.Maui; | ||
using Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
|
||
#pragma warning disable CA2252 | ||
|
||
namespace BlazorBindings.Maui.Elements.Material.Components | ||
{ | ||
public abstract partial class MDBaseLazyView : BlazorBindings.Maui.Elements.ContentView | ||
{ | ||
static MDBaseLazyView() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
public new MCM.BaseLazyView NativeControl => (MCM.BaseLazyView)((BindableObject)this).NativeControl; | ||
|
||
|
||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
141 changes: 141 additions & 0 deletions
141
samples/ThirdPartyControlsSample/Elements/Material.Components/MDCheckBox.generated.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
// <auto-generated> | ||
// This code was generated by a BlazorBindings.Maui component generator. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
|
||
using BlazorBindings.Core; | ||
using BlazorBindings.Maui.Elements; | ||
using MC = Microsoft.Maui.Controls; | ||
using MCM = Material.Components.Maui; | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.Maui.Graphics; | ||
using System.Threading.Tasks; | ||
|
||
#pragma warning disable CA2252 | ||
|
||
namespace BlazorBindings.Maui.Elements.Material.Components | ||
{ | ||
public partial class MDCheckBox : SKTouchCanvasView | ||
{ | ||
static MDCheckBox() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public Color ForegroundColor { get; set; } | ||
[Parameter] public bool? IsChecked { get; set; } | ||
[Parameter] public Color MarkColor { get; set; } | ||
[Parameter] public float? MarkOpacity { get; set; } | ||
[Parameter] public Color OnColor { get; set; } | ||
[Parameter] public float? OnOpacity { get; set; } | ||
[Parameter] public Color OutlineColor { get; set; } | ||
[Parameter] public int? OutlineWidth { get; set; } | ||
[Parameter] public Color RippleColor { get; set; } | ||
[Parameter] public Color StateLayerColor { get; set; } | ||
[Parameter] public EventCallback<bool> IsCheckedChanged { get; set; } | ||
|
||
public new MCM.CheckBox NativeControl => (MCM.CheckBox)((BindableObject)this).NativeControl; | ||
|
||
protected override MCM.CheckBox CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(ForegroundColor): | ||
if (!Equals(ForegroundColor, value)) | ||
{ | ||
ForegroundColor = (Color)value; | ||
NativeControl.ForegroundColor = ForegroundColor; | ||
} | ||
break; | ||
case nameof(IsChecked): | ||
if (!Equals(IsChecked, value)) | ||
{ | ||
IsChecked = (bool?)value; | ||
NativeControl.IsChecked = IsChecked ?? (bool)MCM.CheckBox.IsCheckedProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(MarkColor): | ||
if (!Equals(MarkColor, value)) | ||
{ | ||
MarkColor = (Color)value; | ||
NativeControl.MarkColor = MarkColor; | ||
} | ||
break; | ||
case nameof(MarkOpacity): | ||
if (!Equals(MarkOpacity, value)) | ||
{ | ||
MarkOpacity = (float?)value; | ||
NativeControl.MarkOpacity = MarkOpacity ?? (float)MCM.CheckBox.MarkOpacityProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(OnColor): | ||
if (!Equals(OnColor, value)) | ||
{ | ||
OnColor = (Color)value; | ||
NativeControl.OnColor = OnColor; | ||
} | ||
break; | ||
case nameof(OnOpacity): | ||
if (!Equals(OnOpacity, value)) | ||
{ | ||
OnOpacity = (float?)value; | ||
NativeControl.OnOpacity = OnOpacity ?? (float)MCM.CheckBox.OnOpacityProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(OutlineColor): | ||
if (!Equals(OutlineColor, value)) | ||
{ | ||
OutlineColor = (Color)value; | ||
NativeControl.OutlineColor = OutlineColor; | ||
} | ||
break; | ||
case nameof(OutlineWidth): | ||
if (!Equals(OutlineWidth, value)) | ||
{ | ||
OutlineWidth = (int?)value; | ||
NativeControl.OutlineWidth = OutlineWidth ?? (int)MCM.CheckBox.OutlineWidthProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(RippleColor): | ||
if (!Equals(RippleColor, value)) | ||
{ | ||
RippleColor = (Color)value; | ||
NativeControl.RippleColor = RippleColor; | ||
} | ||
break; | ||
case nameof(StateLayerColor): | ||
if (!Equals(StateLayerColor, value)) | ||
{ | ||
StateLayerColor = (Color)value; | ||
NativeControl.StateLayerColor = StateLayerColor; | ||
} | ||
break; | ||
case nameof(IsCheckedChanged): | ||
if (!Equals(IsCheckedChanged, value)) | ||
{ | ||
void NativeControlCheckedChanged(object sender, MC.CheckedChangedEventArgs e) | ||
{ | ||
var value = NativeControl.IsChecked; | ||
IsChecked = value; | ||
InvokeEventCallback(IsCheckedChanged, value); | ||
} | ||
|
||
IsCheckedChanged = (EventCallback<bool>)value; | ||
NativeControl.CheckedChanged -= NativeControlCheckedChanged; | ||
NativeControl.CheckedChanged += NativeControlCheckedChanged; | ||
} | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
Oops, something went wrong.