-
-
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.
- Loading branch information
1 parent
5f858c0
commit 81aad20
Showing
3 changed files
with
100 additions
and
121 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
src/BlazorBindings.Maui/Elements/HybridWebView.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,72 @@ | ||
// <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 MC = Microsoft.Maui.Controls; | ||
using Microsoft.AspNetCore.Components; | ||
using System.Threading.Tasks; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements | ||
{ | ||
/// <summary> | ||
/// A <see cref="T:Microsoft.Maui.Controls.View" /> that presents local HTML content in a web view and allows JavaScript and C# code to communicate by using messages and by invoking methods. | ||
/// </summary> | ||
public partial class HybridWebView : View | ||
{ | ||
static HybridWebView() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public string DefaultFile { get; set; } | ||
[Parameter] public string HybridRoot { get; set; } | ||
[Parameter] public EventCallback<MC.HybridWebViewRawMessageReceivedEventArgs> OnRawMessageReceived { get; set; } | ||
|
||
public new MC.HybridWebView NativeControl => (MC.HybridWebView)((BindableObject)this).NativeControl; | ||
|
||
protected override MC.HybridWebView CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(DefaultFile): | ||
if (!Equals(DefaultFile, value)) | ||
{ | ||
DefaultFile = (string)value; | ||
NativeControl.DefaultFile = DefaultFile; | ||
} | ||
break; | ||
case nameof(HybridRoot): | ||
if (!Equals(HybridRoot, value)) | ||
{ | ||
HybridRoot = (string)value; | ||
NativeControl.HybridRoot = HybridRoot; | ||
} | ||
break; | ||
case nameof(OnRawMessageReceived): | ||
if (!Equals(OnRawMessageReceived, value)) | ||
{ | ||
void NativeControlRawMessageReceived(object sender, MC.HybridWebViewRawMessageReceivedEventArgs e) => InvokeEventCallback(OnRawMessageReceived, e); | ||
|
||
OnRawMessageReceived = (EventCallback<MC.HybridWebViewRawMessageReceivedEventArgs>)value; | ||
NativeControl.RawMessageReceived -= NativeControlRawMessageReceived; | ||
NativeControl.RawMessageReceived += NativeControlRawMessageReceived; | ||
} | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
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