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

没有正确的解决方案

其他提示

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]);
    }
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top