| Start |
|---|
| Import CarouselView The easiest way to import CarouselView is to use the NuGet-Packages Manager in Xamarin / Visual studio:
To use pre-release packages, make sure you enable the 'Show pre-release packages' checkbox at the left corner. Each sub-project (.iOS/.droid./.WinPhone) must import this package. |
Import CarouselView into a XAML Page The basicsIn the heading of ContentPage, insert following line: Between the <ContentPage.Content> tags place the CarouselView: x:Name will give your CarouselView a name, which can be used in the C# code behind file. This is the basics you need to do for integrating CarouselView into a view. The given examples will not show you anything because the CarouselView is empty. Creating bindable sourceAs example of an ItemSource, I will be using a ObservableCollection of strings. TechGiant is a class that will host names of Technology Giants After the InitializeComponent of your page, create and fill the ObservableCollection At last, set TechGiants to be the ItemSource of the DemoCarouselView DataTemplatesIn the XAML - file, give the CarouselView a DataTemplate: Define a DataTemplate. In this case, this will be a Label with text bind to the itemsource and a green background: That's it! Run the program and see the result! RemarksCarouselView is a Xamarin Control which can contains any kind of View. This pre-release control can only be used in Xamarin Forms projects. In the example provided by James Montemagno (opens new window), on the blog of Xamarin, CarouselView is used to display images. At this moment CarouselView is not integrated in Xamarin.Forms. To use this in your project(s), you will have to add the NuGet-Package (see example above). |
Read Article
https://develop.horje.com/learn/1434/reference