Pergunta

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).

Nenhuma solução correta

Outras dicas

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]);
    }
}
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top