//viewModel:
public class MainWindowModel : NotificationObject
{
public MainWindowModel()
{
Items.Add(new TabItem(){Header = "123"});
Items.Add(new TabItem(){Header = "abc"});
Items.Add(new TabItem(){Header = "a12"});
}
private List_items=new List ();
public ListItems
{
get { return _items; }
set
{
_items = value;
RaisePropertyChanged(nameof(Items));
}
}
}
//View:
效果图