mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-04-05 17:37:51 +08:00
23 lines
681 B
C#
23 lines
681 B
C#
// Copyright (c) Microsoft Corporation.
|
|
// Licensed under the MIT license.
|
|
|
|
using System;
|
|
|
|
namespace CPF.BlazorBindings
|
|
{
|
|
internal class ElementHandlerFactory
|
|
{
|
|
private readonly Func<NativeComponentRenderer, IElementHandler, IElementHandler> _callback;
|
|
|
|
public ElementHandlerFactory(Func<NativeComponentRenderer, IElementHandler, IElementHandler> callback)
|
|
{
|
|
_callback = callback ?? throw new ArgumentNullException(nameof(callback));
|
|
}
|
|
|
|
public IElementHandler CreateElementHandler(ElementHandlerFactoryContext context)
|
|
{
|
|
return _callback(context.Renderer, context.ParentHandler);
|
|
}
|
|
}
|
|
}
|