Có gì sai vớiC#: khả năng tiếp cận nhất quán: Loại tài sản
public partial class MainWindow : Window
{
public ObservableCollection<TabViewModel> Tabs { get; set; }
public ICollectionView TabsViewSource { get; set; }
public int CurrentIndex { get { return TabsViewSource.CurrentPosition; } }
tôi nhận được
khả năng tiếp cận nhất quán: Loại bất động sản 'System.Collections.ObjectModel.ObservableCollection' là khó tiếp cận hơn tài sản 'TabsRendering. MainWindow.Tabs '
khi tôi thay đổi mã thành
public partial class MainWindow : Window
{
ObservableCollection<TabViewModel> Tabs { get; set; }
public ICollectionView TabsViewSource { get; set; }
public int CurrentIndex { get { return TabsViewSource.CurrentPosition; } }
Nó hoạt động. Có sự cố với số public
trên ObservableCollection
Giải thích tuyệt vời –
oh ... Tôi đã kiểm tra 'MainWindow' là công khai ... lol –
nó đã giúp tôi.thanks Ani –