Ejemplo n.º 1
0
        public CarouselViewModel()
        {
            Position = 0;

            ItemsSource = new ObservableCollection <View>()
            {
                new MyFirstView()
                {
                    BindingContext = 0
                },
                new MyFirstView()
                {
                    BindingContext = 1
                },
                new MyFirstView()
                {
                    BindingContext = 2
                },
                new MyFirstView()
                {
                    BindingContext = 3
                },
                new MyFirstView()
                {
                    BindingContext = 4
                }
            };

            TemplateSelector = new MyTemplateSelector(); //new DataTemplate (typeof(MyView));
        }
Ejemplo n.º 2
0
 public MainViewModel()
 {
     Position    = 0;
     ItemsSource = new ObservableCollection <int>()
     {
         0, 1
     };
     TemplateSelector = new MyTemplateSelector();             //new DataTemplate (typeof(MyView));
 }