Question

I use data binding to create a panorama page. When I go to this page, it will show all of items I add in the MainViewModel.cs. Is it possible to just show specific items(likes item2~item4)on this panorama page. Because I would like to create many different pages using the same ViewModel(but different several items).

Pas de solution correcte

Autres conseils

You implement two lists in your ViewModel one public which you bind your panorama to and one private which contains all the pages.

public class MainViewModel
{    
    public ObservableCollection<String> ItemsDisplayed; 
    private List<String> _fullList;
    public void UpdateItemsDisplayed()
    {
        if(someCriteria)
             ItemsDisplayed.Add(_fullList[1]);
    }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top