【发布时间】:2017-08-27 12:57:15
【问题描述】:
我正在尝试在 xaml 的内容视图类中设置/绑定列表属性。
这是我的班级:
public class Myclass:ContentView
{
public static readonly BindableProperty TabItemSourceProperty = BindableProperty.Create(
"TabIndicatorItemSource",
typeof(IEnumerable<string>),
typeof(Myclass)
);
public IEnumerable<string> TabIndicatorItemSource {
get
{
return (IEnumerable<string>)GetValue(TabItemSourceProperty);
}
set
{
SetValue(TabItemSourceProperty, value);
}
}}
这是我在 ExampleClass.xaml.cs 中的 Xaml
local:Myclass x:Name="myCarouselView" TabTextSizeTabIndicatorItemSource ="{Binding tabListSource}"
tabListSource 是 ExampleClass.cs 中的 List 属性。
但是我得到了这种类型不匹配的错误。我哪里错了?
【问题讨论】:
标签: c# xaml xamarin binding xamarin.forms