【发布时间】:2019-11-26 14:33:16
【问题描述】:
我正在尝试将列表中的整数值链接到 StackLayout 的扩展值“索引”。无论我尝试做什么,尽管将所有数据都设置为“7”(随机),但该值始终为 0。
扩展代码如下:
public class NamedStackLayout : StackLayout
{
public string Name { get; set; }
public int Index { get; set; }
public static readonly BindableProperty IndexProperty = BindableProperty.Create("Index", typeof(int), typeof(NamedStackLayout), 1);
public int IndexValue
{
get { return (int)GetValue(IndexProperty); }
set { SetValue(IndexProperty, value); }
}
}
【问题讨论】:
-
可以吗?