سؤال

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