Different Pivot Tabview Items

May 29, 2012 at 6:49 PM

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.

May 29, 2012 at 9:19 PM

Sorry, I'm a bit new to caliburn/mvvm !!!!!!

I figured things out.