{"id":23061653,"url":"https://github.com/syncfusionexamples/xamarin-forms-rotator","last_synced_at":"2026-05-02T04:40:26.217Z","repository":{"id":98096399,"uuid":"361752514","full_name":"SyncfusionExamples/xamarin-forms-rotator","owner":"SyncfusionExamples","description":"This example demonstrates integration of SfRotator component into Xamarin.Forms projects, including basic usage and advanced configurations.","archived":false,"fork":false,"pushed_at":"2024-03-22T10:42:42.000Z","size":49137,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-02-08T20:48:18.489Z","etag":null,"topics":["rotator","rotator-controller","xamarin","xamarin-forms","xamarin-rotator"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SyncfusionExamples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-04-26T13:03:45.000Z","updated_at":"2024-03-28T11:06:09.000Z","dependencies_parsed_at":"2025-02-08T20:46:30.951Z","dependency_job_id":"f76946d7-f19c-428e-88c0-cae6a504c6ca","html_url":"https://github.com/SyncfusionExamples/xamarin-forms-rotator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-rotator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-rotator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-rotator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SyncfusionExamples%2Fxamarin-forms-rotator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SyncfusionExamples","download_url":"https://codeload.github.com/SyncfusionExamples/xamarin-forms-rotator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246952280,"owners_count":20859813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["rotator","rotator-controller","xamarin","xamarin-forms","xamarin-rotator"],"created_at":"2024-12-16T03:18:02.624Z","updated_at":"2026-05-02T04:40:26.174Z","avatar_url":"https://github.com/SyncfusionExamples.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Xamarin Rotator (SfRotator)\n\nThe Rotator is a data control used to display image data and navigate through them. The images can be selected either by Thumbnail or by Dots support.\n\nFor know more details about Rotator: https://www.syncfusion.com/xamarin-ui-controls/xamarin-rotator\n\nRotator user guide documentation: https://help.syncfusion.com/xamarin/rotator/getting-started\n\n##   Create a Simple SfRotator\nThe SfRotator control is configured entirely in C# code or by using XAML markup. The following steps explain on how to create a SfRotator and configure its elements,\n\nAdding namespace for the added assemblies.\n\n**[XAML]**\n```\nxmlns:rotator=\"clr-namespace:Syncfusion.SfRotator.XForms;assembly=Syncfusion.SfRotator.XForms\"\n```\n**[XAML]**\nNow add the SfRotator control with a required optimal name by using the included namespace.\n\n```\n\u003c?xml version=\"1.0\" encoding=\"utf-8\"?\u003e\n\u003cContentPage xmlns=\"http://xamarin.com/schemas/2014/forms\" \n\txmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\n\txmlns:local=\"clr-namespace:GettingStarted\" \n\txmlns:syncfusion=\"clr-namespace:Syncfusion.SfRotator.XForms;assembly=Syncfusion.SfRotator.XForms\"\n\tx:Class=\"GettingStarted.RotatorControlPage\"\u003e\n\u003cContentPage.Content\u003e\n \u003csyncfusion:SfRotator x:Name=\"rotator\" /\u003e\t\n\u003c/ContentPage.Content\u003e\n\u003c/ContentPage\u003e\n```\n\n## Add Rotator Items\nWe can populate the rotator’s items by using any one of the following ways,\n\n*   Through SfRotatorItem\n\n*   Through ItemTemplate\n\n###  Through SfRotatorItem\nBy passing the list of SfRotatorItem , we can get the view of SfRotator control. In that we can pass Images as well as Item content.\n\nThe following code example illustrates to add list of Images in Rotator ,\n\n**[C#]**\n\n```\npublic partial class Rotator : ContentPage\n\t{\n        SfRotator rotator = new SfRotator();\n        StackLayout stackLayout = new StackLayout();\n\t\tpublic Rotator()\n\t\t{\n\t\t\tInitializeComponent ();\n            stackLayout.HeightRequest = 300;\n            List\u003cSfRotatorItem\u003e collectionOfItems = new List\u003cSfRotatorItem\u003e();\n            collectionOfItems.Add(new SfRotatorItem() { Image = \"movie1.png\" });\n            collectionOfItems.Add(new SfRotatorItem() { Image = \"movie2.png\" });\n            collectionOfItems.Add(new SfRotatorItem() { Image = \"movie3.png\" });\n            collectionOfItems.Add(new SfRotatorItem() { Image = \"movie4.png\" });\n            collectionOfItems.Add(new SfRotatorItem() { Image = \"movie5.png\" });\n            rotator.DataSource = collectionOfItems;\n            stackLayout.Children.Add(rotator);\n            this.Content = stackLayout;\n        }\n\t}\n```\n\nThe following code example illustrates to add list of items through ItemContent API in Rotator ,\n\n**[C#]**\n\n```\n public partial class Rotator : ContentPage\n    {\n        SfRotator rotator;\n        public Rotator()\n        {\n            InitializeComponent();\n            SfRotator rotator = new SfRotator();\n            List\u003cSfRotatorItem\u003e collectionOfItems = new List\u003cSfRotatorItem\u003e();\n            collectionOfItems.Add(new SfRotatorItem() { ItemContent = new Xamarin.Forms.Button() { Text = \"RotatorButton\", TextColor = Color.White, BackgroundColor = Color.FromHex(\"#7E6E6B\"), FontSize = 12 } });\n            collectionOfItems.Add(new SfRotatorItem() { ItemContent = new Label() { Text = \"RotatorLabel\", BackgroundColor = Color.FromHex(\"#7E6E6B\"), FontSize = 12 } });\n            collectionOfItems.Add(new SfRotatorItem() { ItemContent = new Image() { Source = \"image1.png\", Aspect = Aspect.AspectFit } });\n            rotator.DataSource = collectionOfItems;\n            this.Content = rotator;\n        }\n    }\n```\n###  Through ItemTemplate\nItemTemplate property of SfRotator control is used to customize the contents of SfRotator items. ItemTemplate provides common template with different data. SfRotator items can be populated with a collection of image data. This collection includes Arrays, Lists and DataTables.\n\n**[C#]**\n```\npublic RotatorModel(string imageString)\n{\n    Image = imageString;\n}\nprivate String _image;\npublic String Image\n{\n    get { return _image; }\n    set { _image = value; }\n}\n```\nCreate and populate Rotator collection as follows\n\n```\npublic RotatorViewModel()\n{\n    ImageCollection.Add(new RotatorModel(\"movie1.png\"));\n    ImageCollection.Add(new RotatorModel(\"movie2.png\"));\n    ImageCollection.Add(new RotatorModel(\"movie3.png\"));\n    ImageCollection.Add(new RotatorModel(\"movie4.png\"));\n    ImageCollection.Add(new RotatorModel(\"movie5.png\"));\n}\nprivate List\u003cRotatorModel\u003e imageCollection = new List\u003cRotatorModel\u003e();\npublic List\u003cRotatorModel\u003e ImageCollection\n{\n    get { return imageCollection; }\n    set { imageCollection = value; }\n}\n```\n**[XAML]**\n\n```\n    \u003cContentPage.BindingContext\u003e\n        \u003clocal:RotatorViewModel/\u003e\n    \u003c/ContentPage.BindingContext\u003e\n    \u003cContentPage.Content\u003e\n        \u003csyncfusion:SfRotator x:Name=\"rotator\" \n                        NavigationDelay=\"2000\" \n                        ItemsSource=\"{Binding ImageCollection}\" \n                        SelectedIndex=\"2\"\n                        NavigationDirection=\"Horizontal\"\n                        NavigationStripMode=\"Dots\" \n                        BackgroundColor=\"#ececec\"\u003e\n            \u003csyncfusion:SfRotator.ItemTemplate\u003e\n                \u003cDataTemplate\u003e\n                    \u003cImage  Source=\"{Binding Image}\"/\u003e\n                \u003c/DataTemplate\u003e\n            \u003c/syncfusion:SfRotator.ItemTemplate\u003e\n        \u003c/syncfusion:SfRotator\u003e\n    \u003c/ContentPage.Content\u003e\n```\n*   Set the BindingContext for the items collection.\n\n**[XAML]**\n```\n\u003cContentPage.BindingContext\u003e\n        \u003clocal:RotatorViewModel/\u003e\n\u003c/ContentPage.BindingContext\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncfusionexamples%2Fxamarin-forms-rotator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyncfusionexamples%2Fxamarin-forms-rotator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyncfusionexamples%2Fxamarin-forms-rotator/lists"}