-
-
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.
- Loading branch information
1 parent
5b310be
commit cd9430f
Showing
11 changed files
with
374 additions
and
135 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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<ContentPage Title="Context Menu" BackgroundColor="_selectedColor"> | ||
<VerticalStackLayout> | ||
<Label Text="Right click to open context menu"> | ||
<ContextFlyout> | ||
<MenuFlyout> | ||
<MenuFlyoutItem Text="Black" OnClick="() => SelectColor(Colors.Black)" /> | ||
|
||
<MenuFlyoutSubItem Text="Light"> | ||
<MenuFlyoutItem Text="Blue" OnClick="() => SelectColor(Colors.LightBlue)" /> | ||
<MenuFlyoutItem Text="Coral" OnClick="() => SelectColor(Colors.LightCoral)" /> | ||
<MenuFlyoutItem Text="Cyan" OnClick="() => SelectColor(Colors.LightCyan)" /> | ||
</MenuFlyoutSubItem> | ||
|
||
<MenuFlyoutSubItem Text="Dark"> | ||
<MenuFlyoutItem Text="Blue" OnClick="() => SelectColor(Colors.DarkBlue)" /> | ||
<MenuFlyoutItem Text="DarkMagenta" OnClick="() => SelectColor(Colors.DarkMagenta)" /> | ||
<MenuFlyoutItem Text="Cyan" OnClick="() => SelectColor(Colors.DarkCyan)" /> | ||
</MenuFlyoutSubItem> | ||
</MenuFlyout> | ||
</ContextFlyout> | ||
</Label> | ||
</VerticalStackLayout> | ||
|
||
</ContentPage> | ||
|
||
@code { | ||
Color? _selectedColor = null; | ||
|
||
void SelectColor(Color color) => _selectedColor = color; | ||
} |
132 changes: 0 additions & 132 deletions
132
...es/ThirdPartyControlsSample/Elements/Material.Components/MDSKTouchCanvasView.generated.cs
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
using Microsoft.AspNetCore.Components.Rendering; | ||
using MC = Microsoft.Maui.Controls; | ||
|
||
namespace BlazorBindings.Maui.Elements; | ||
|
||
public partial class Element | ||
{ | ||
[Parameter] public RenderFragment ContextFlyout { get; set; } | ||
|
||
protected override bool HandleAdditionalParameter(string name, object value) | ||
{ | ||
if (name == nameof(ContextFlyout)) | ||
{ | ||
ContextFlyout = (RenderFragment)value; | ||
return true; | ||
} | ||
|
||
return base.HandleAdditionalParameter(name, value); | ||
} | ||
|
||
protected override void RenderAdditionalPartialElementContent(RenderTreeBuilder builder, ref int sequence) | ||
{ | ||
base.RenderAdditionalPartialElementContent(builder, ref sequence); | ||
|
||
RenderTreeBuilderHelper.AddContentProperty<MC.Element>(builder, sequence++, ContextFlyout, (x, value) => | ||
MC.FlyoutBase.SetContextFlyout(x, (MC.FlyoutBase)value)); | ||
} | ||
} |
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,30 @@ | ||
// <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 | ||
{ | ||
public abstract partial class FlyoutBase : Element | ||
{ | ||
static FlyoutBase() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
public new MC.FlyoutBase NativeControl => (MC.FlyoutBase)((BindableObject)this).NativeControl; | ||
|
||
|
||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
src/BlazorBindings.Maui/Elements/KeyboardAccelerator.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,68 @@ | ||
// <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 Microsoft.Maui; | ||
using System.Threading.Tasks; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements | ||
{ | ||
/// <summary> | ||
/// Represents a shortcut key for a <see cref="T:Microsoft.Maui.Controls.MenuFlyoutItem" />. | ||
/// </summary> | ||
public partial class KeyboardAccelerator : BindableObject | ||
{ | ||
static KeyboardAccelerator() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
/// <summary> | ||
/// Identifies the key for the keyboard accelerator. | ||
/// </summary> | ||
[Parameter] public string Key { get; set; } | ||
/// <summary> | ||
/// Identifies the modifiers for the keyboard accelerator. | ||
/// </summary> | ||
[Parameter] public KeyboardAcceleratorModifiers? Modifiers { get; set; } | ||
|
||
public new MC.KeyboardAccelerator NativeControl => (MC.KeyboardAccelerator)((BindableObject)this).NativeControl; | ||
|
||
protected override MC.KeyboardAccelerator CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(Key): | ||
if (!Equals(Key, value)) | ||
{ | ||
Key = (string)value; | ||
NativeControl.Key = Key; | ||
} | ||
break; | ||
case nameof(Modifiers): | ||
if (!Equals(Modifiers, value)) | ||
{ | ||
Modifiers = (KeyboardAcceleratorModifiers?)value; | ||
NativeControl.Modifiers = Modifiers ?? (KeyboardAcceleratorModifiers)MC.KeyboardAccelerator.ModifiersProperty.DefaultValue; | ||
} | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// <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 Microsoft.AspNetCore.Components.Rendering; | ||
using Microsoft.Maui; | ||
using System.Threading.Tasks; | ||
|
||
#pragma warning disable MBB001 | ||
|
||
namespace BlazorBindings.Maui.Elements | ||
{ | ||
public partial class MenuFlyout : FlyoutBase | ||
{ | ||
static MenuFlyout() | ||
{ | ||
RegisterAdditionalHandlers(); | ||
} | ||
|
||
[Parameter] public RenderFragment ChildContent { get; set; } | ||
|
||
public new MC.MenuFlyout NativeControl => (MC.MenuFlyout)((BindableObject)this).NativeControl; | ||
|
||
protected override MC.MenuFlyout CreateNativeElement() => new(); | ||
|
||
protected override void HandleParameter(string name, object value) | ||
{ | ||
switch (name) | ||
{ | ||
case nameof(ChildContent): | ||
ChildContent = (RenderFragment)value; | ||
break; | ||
|
||
default: | ||
base.HandleParameter(name, value); | ||
break; | ||
} | ||
} | ||
|
||
protected override void RenderAdditionalElementContent(RenderTreeBuilder builder, ref int sequence) | ||
{ | ||
base.RenderAdditionalElementContent(builder, ref sequence); | ||
RenderTreeBuilderHelper.AddListContentProperty<MC.MenuFlyout, IMenuElement>(builder, sequence++, ChildContent, x => x); | ||
} | ||
|
||
static partial void RegisterAdditionalHandlers(); | ||
} | ||
} |
Oops, something went wrong.