我决定在Angular中将控件制作成指令以便重复使用,但目前只实现了广告。
namespace Chainhub.Forms.UI.Controls
{
public partial class BoxPickerControl : ContentView
{
public BoxPickerControl()
{
InitializeComponent();
}
}
}
示例中的BoxPickerControl
<?xml version="1.0" encoding="utf-8" ?>
<ContentView xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Chainhub.Forms.UI.Controls.BoxPickerControl">
<StackLayout>
<StackLayout>
<StackLayout BackgroundColor="#383940" Padding="5,5,5,5" Orientation="Horizontal">
<StackLayout HorizontalOptions="StartAndExpand">
<Label Text="Categories" TextColor="White"></Label>
</StackLayout>
</ContentView>
在内容页面中注册并调用
<controls:BoxPickerControl>
</controls:BoxPickerControl>
并成功捕获
目标调用异常
我做错了什么吗?