我想創建一個自定義的TabbedView,但是當我添加一些CustomTab槽xaml頁面時,可綁定的屬性不會改變。BindableProperty列表不會改變
下面的代碼有什麼錯誤?
在此先感謝。
public static readonly BindableProperty TabsProperty = BindableProperty.Create("Tabs", typeof(List<CustomTab>), typeof(TabbedView), new List<CustomTab>(), BindingMode.Default, null, TabsPropertyChanged, TabsPropertyChanging);
public List<CustomTab> Tabs
{
get
{
return (List<CustomTab>)GetValue(TabsProperty);
}
set
{
SetValue(TabsProperty, value);
OnPropertyChanged("Tabs");
}
}
private static void TabsPropertyChanging(BindableObject bindable, object oldValue, object newValue)
{
}
private static void TabsPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
}
XAML
<pageComponents:TabbedView x:Name="myTabs">
<pageComponents:TabbedView.Tabs>
<pageComponents:CustomTab></pageComponents:CustomTab>
<pageComponents:CustomTab></pageComponents:CustomTab>
<pageComponents:CustomTab></pageComponents:CustomTab>
</pageComponents:TabbedView.Tabs>
</pageComponents:TabbedView>