-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add The49.Maui.BottomSheet sample page (#162)
- Loading branch information
1 parent
0ef114c
commit 14c7a6a
Showing
19 changed files
with
525 additions
and
7 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
|
@@ -6,4 +6,5 @@ | |
<XCalendarPage/> | ||
<MaterialComponentsPage/> | ||
<SkiaCanvasPage/> | ||
<BottomSheetPage/> | ||
</Shell> |
55 changes: 55 additions & 0 deletions
55
samples/ThirdPartyControlsSample/Elements/The49.BottomSheet/AnchorDetent.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,55 @@ | ||
// <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 Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Rendering; | ||
using System.Threading.Tasks; | ||
using TMB = The49.Maui.BottomSheet; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements.The49.BottomSheet | ||
{ | ||
public partial class AnchorDetent : Detent | ||
{ | ||
static AnchorDetent() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public RenderFragment Anchor { get; set; } | ||
|
||
public new TMB.AnchorDetent NativeControl => (TMB.AnchorDetent)((BindableObject)this).NativeControl; | ||
|
||
protected override TMB.AnchorDetent CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(Anchor): | ||
Anchor = (RenderFragment)value; | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
protected override void RenderAdditionalElementContent(RenderTreeBuilder builder, ref int sequence) | ||
{ | ||
base.RenderAdditionalElementContent(builder, ref sequence); | ||
RenderTreeBuilderHelper.AddContentProperty<TMB.AnchorDetent>(builder, sequence++, Anchor, (x, value) => x.Anchor = (MC.VisualElement)value); | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
130 changes: 130 additions & 0 deletions
130
samples/ThirdPartyControlsSample/Elements/The49.BottomSheet/BottomSheet.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,130 @@ | ||
// <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 Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Rendering; | ||
using Microsoft.Maui.Graphics; | ||
using System; | ||
using System.Threading.Tasks; | ||
using TMB = The49.Maui.BottomSheet; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements.The49.BottomSheet | ||
{ | ||
public partial class BottomSheet : BlazorBindings.Maui.Elements.ContentView | ||
{ | ||
static BottomSheet() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public double? CornerRadius { get; set; } | ||
[Parameter] public Color HandleColor { get; set; } | ||
[Parameter] public bool? HasBackdrop { get; set; } | ||
[Parameter] public bool? HasHandle { get; set; } | ||
[Parameter] public bool? IsCancelable { get; set; } | ||
[Parameter] public RenderFragment Detents { get; set; } | ||
[Parameter] public EventCallback<TMB.DismissOrigin> OnDismissed { get; set; } | ||
[Parameter] public EventCallback OnShowing { get; set; } | ||
[Parameter] public EventCallback OnShown { get; set; } | ||
|
||
public new TMB.BottomSheet NativeControl => (TMB.BottomSheet)((BindableObject)this).NativeControl; | ||
|
||
protected override TMB.BottomSheet CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(CornerRadius): | ||
if (!Equals(CornerRadius, value)) | ||
{ | ||
CornerRadius = (double?)value; | ||
NativeControl.CornerRadius = CornerRadius ?? (double)TMB.BottomSheet.CornerRadiusProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(HandleColor): | ||
if (!Equals(HandleColor, value)) | ||
{ | ||
HandleColor = (Color)value; | ||
NativeControl.HandleColor = HandleColor; | ||
} | ||
break; | ||
case nameof(HasBackdrop): | ||
if (!Equals(HasBackdrop, value)) | ||
{ | ||
HasBackdrop = (bool?)value; | ||
NativeControl.HasBackdrop = HasBackdrop ?? (bool)TMB.BottomSheet.HasBackdropProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(HasHandle): | ||
if (!Equals(HasHandle, value)) | ||
{ | ||
HasHandle = (bool?)value; | ||
NativeControl.HasHandle = HasHandle ?? (bool)TMB.BottomSheet.HasHandleProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(IsCancelable): | ||
if (!Equals(IsCancelable, value)) | ||
{ | ||
IsCancelable = (bool?)value; | ||
NativeControl.IsCancelable = IsCancelable ?? (bool)TMB.BottomSheet.IsCancelableProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(Detents): | ||
Detents = (RenderFragment)value; | ||
break; | ||
case nameof(OnDismissed): | ||
if (!Equals(OnDismissed, value)) | ||
{ | ||
void NativeControlDismissed(object sender, TMB.DismissOrigin e) => InvokeEventCallback(OnDismissed, e); | ||
|
||
OnDismissed = (EventCallback<TMB.DismissOrigin>)value; | ||
NativeControl.Dismissed -= NativeControlDismissed; | ||
NativeControl.Dismissed += NativeControlDismissed; | ||
} | ||
break; | ||
case nameof(OnShowing): | ||
if (!Equals(OnShowing, value)) | ||
{ | ||
void NativeControlShowing(object sender, EventArgs e) => InvokeEventCallback(OnShowing); | ||
|
||
OnShowing = (EventCallback)value; | ||
NativeControl.Showing -= NativeControlShowing; | ||
NativeControl.Showing += NativeControlShowing; | ||
} | ||
break; | ||
case nameof(OnShown): | ||
if (!Equals(OnShown, value)) | ||
{ | ||
void NativeControlShown(object sender, EventArgs e) => InvokeEventCallback(OnShown); | ||
|
||
OnShown = (EventCallback)value; | ||
NativeControl.Shown -= NativeControlShown; | ||
NativeControl.Shown += NativeControlShown; | ||
} | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
protected override void RenderAdditionalElementContent(RenderTreeBuilder builder, ref int sequence) | ||
{ | ||
base.RenderAdditionalElementContent(builder, ref sequence); | ||
RenderTreeBuilderHelper.AddListContentProperty<TMB.BottomSheet, TMB.Detent>(builder, sequence++, Detents, x => x.Detents); | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
samples/ThirdPartyControlsSample/Elements/The49.BottomSheet/ContentDetent.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,33 @@ | ||
// <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 Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
using TMB = The49.Maui.BottomSheet; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements.The49.BottomSheet | ||
{ | ||
public partial class ContentDetent : Detent | ||
{ | ||
static ContentDetent() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
public new TMB.ContentDetent NativeControl => (TMB.ContentDetent)((BindableObject)this).NativeControl; | ||
|
||
protected override TMB.ContentDetent CreateNativeElement() => new(); | ||
|
||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
samples/ThirdPartyControlsSample/Elements/The49.BottomSheet/Detent.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,59 @@ | ||
// <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 Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
using TMB = The49.Maui.BottomSheet; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements.The49.BottomSheet | ||
{ | ||
public abstract partial class Detent : BlazorBindings.Maui.Elements.BindableObject | ||
{ | ||
static Detent() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public bool? IsDefault { get; set; } | ||
[Parameter] public bool? IsEnabled { get; set; } | ||
|
||
public new TMB.Detent NativeControl => (TMB.Detent)((BindableObject)this).NativeControl; | ||
|
||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(IsDefault): | ||
if (!Equals(IsDefault, value)) | ||
{ | ||
IsDefault = (bool?)value; | ||
NativeControl.IsDefault = IsDefault ?? (bool)TMB.Detent.IsDefaultProperty.DefaultValue; | ||
} | ||
break; | ||
case nameof(IsEnabled): | ||
if (!Equals(IsEnabled, value)) | ||
{ | ||
IsEnabled = (bool?)value; | ||
NativeControl.IsEnabled = IsEnabled ?? (bool)TMB.Detent.IsEnabledProperty.DefaultValue; | ||
} | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
samples/ThirdPartyControlsSample/Elements/The49.BottomSheet/FullscreenDetent.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,33 @@ | ||
// <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 Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
using TMB = The49.Maui.BottomSheet; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements.The49.BottomSheet | ||
{ | ||
public partial class FullscreenDetent : Detent | ||
{ | ||
static FullscreenDetent() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
public new TMB.FullscreenDetent NativeControl => (TMB.FullscreenDetent)((BindableObject)this).NativeControl; | ||
|
||
protected override TMB.FullscreenDetent CreateNativeElement() => new(); | ||
|
||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
samples/ThirdPartyControlsSample/Elements/The49.BottomSheet/HeightDetent.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,52 @@ | ||
// <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 Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
using TMB = The49.Maui.BottomSheet; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements.The49.BottomSheet | ||
{ | ||
public partial class HeightDetent : Detent | ||
{ | ||
static HeightDetent() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public double? Height { get; set; } | ||
|
||
public new TMB.HeightDetent NativeControl => (TMB.HeightDetent)((BindableObject)this).NativeControl; | ||
|
||
protected override TMB.HeightDetent CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(Height): | ||
if (!Equals(Height, value)) | ||
{ | ||
Height = (double?)value; | ||
NativeControl.Height = Height ?? (double)TMB.HeightDetent.HeightProperty.DefaultValue; | ||
} | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
Oops, something went wrong.