|
In the latest source download. Using the WP7 sample app (Pivot based).
Please can someone show me how to create tabs with various viewmodels other than the supplied TabView.
Can do this:-
var
tab = createTab();
tab.DisplayName
= "Item X"
;
Items.Add(tab);
/*
Enumerable.Range(1, NumberOfTabs).Apply(x => {
var tab = createTab();
tab.DisplayName = "Item " + x;
Items.Add(tab);
});
*/
But when I add this:-
readonly
Func<MyTabViewModel>
createTab1;
public
PivotPageViewModel(Func<MyTabViewModel>
createTab1)
{
this.createTab1
= createTab1;
}
var
tab1 = createTab1();
tab1.
DisplayName
= "MyItem X";
Items.Add(tab1);
... createTab1 becomes null!
Thanks.
|