{"action":"created","issue":{"url":"https://api.github.com/repos/AndreiMisiukevich/CardView/issues/45","repository_url":"https://api.github.com/repos/AndreiMisiukevich/CardView","labels_url":"https://api.github.com/repos/AndreiMisiukevich/CardView/issues/45/labels{/name}","comments_url":"https://api.github.com/repos/AndreiMisiukevich/CardView/issues/45/comments","events_url":"https://api.github.com/repos/AndreiMisiukevich/CardView/issues/45/events","html_url":"https://github.com/AndreiMisiukevich/CardView/issues/45","id":337875358,"node_id":"MDU6SXNzdWUzMzc4NzUzNTg=","number":45,"title":"ItemTemplate visual BindingContext getting copied between the Items property of the CarouselView","user":{"login":"Juansero29","id":19156405,"node_id":"MDQ6VXNlcjE5MTU2NDA1","avatar_url":"https://avatars3.githubusercontent.com/u/19156405?v=4","gravatar_id":"","url":"https://api.github.com/users/Juansero29","html_url":"https://github.com/Juansero29","followers_url":"https://api.github.com/users/Juansero29/followers","following_url":"https://api.github.com/users/Juansero29/following{/other_user}","gists_url":"https://api.github.com/users/Juansero29/gists{/gist_id}","starred_url":"https://api.github.com/users/Juansero29/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Juansero29/subscriptions","organizations_url":"https://api.github.com/users/Juansero29/orgs","repos_url":"https://api.github.com/users/Juansero29/repos","events_url":"https://api.github.com/users/Juansero29/events{/privacy}","received_events_url":"https://api.github.com/users/Juansero29/received_events","type":"User","site_admin":false},"labels":[{"id":799924493,"node_id":"MDU6TGFiZWw3OTk5MjQ0OTM=","url":"https://api.github.com/repos/AndreiMisiukevich/CardView/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-07-03T12:21:43Z","updated_at":"2018-07-04T14:02:27Z","closed_at":null,"author_association":"NONE","body":"I use the CarouselView inside a ContentView. This CarouselView has a binding to a list of Weeks (in order to print out the weeks for a certain year). Then, I use the ItemTemplate to print each week as I want to.  Each week then has to print its 7 days via a DayCell custom control (another ContentView) to which I assign the BindingContext from the XAML code. Here's the XAML: \r\n\r\n````\r\n<ContentView xmlns=\"http://xamarin.com/schemas/2014/forms\" \r\n             xmlns:x=\"http://schemas.microsoft.com/winfx/2009/xaml\"\r\n             x:Class=\"NomadApp.Helpers.Controls.Agenda.Agenda\"\r\n             xmlns:Carousel=\"clr-namespace:PanCardView;assembly=PanCardView\"\r\n             xmlns:AgendaHelpers=\"clr-namespace:NomadApp.Helpers.Controls.Agenda\"\r\n             x:Name=\"this\">\r\n\r\n    <ContentView.Content>\r\n\r\n\r\n                <Carousel:CarouselView Grid.Row=\"1\" \r\n                                       x:Name=\"carouselView\" \r\n                                       Items=\"{Binding Source={x:Reference this}, Path=Weeks}\"\r\n                                       SwipeThresholdDistance=\"300\" \r\n                                       VerticalOptions=\"FillAndExpand\" >\r\n                    \r\n                    <Carousel:CarouselView.ItemTemplate>\r\n                        <DataTemplate>\r\n\r\n                            <Grid x:Name=\"daysGrid\">\r\n\r\n                                <Grid.RowDefinitions>\r\n                                    <RowDefinition Height=\"*\"/>\r\n                                </Grid.RowDefinitions>\r\n\r\n                                <Grid.ColumnDefinitions>\r\n                                    <ColumnDefinition/>\r\n                                    <ColumnDefinition/>\r\n                                    <ColumnDefinition/>\r\n                                    <ColumnDefinition/>\r\n                                    <ColumnDefinition/>\r\n                                    <ColumnDefinition/>\r\n                                    <ColumnDefinition/>\r\n                                </Grid.ColumnDefinitions>\r\n\r\n                                <AgendaHelpers:DayCell Grid.Column=\"0\" BindingContext=\"{Binding Days[0]}\"/>\r\n                                <AgendaHelpers:DayCell Grid.Column=\"1\" BindingContext=\"{Binding Days[1]}\"/>\r\n                                <AgendaHelpers:DayCell Grid.Column=\"2\" BindingContext=\"{Binding Days[2]}\"/>\r\n                                <AgendaHelpers:DayCell Grid.Column=\"3\" BindingContext=\"{Binding Days[3]}\"/>\r\n                                <AgendaHelpers:DayCell Grid.Column=\"4\" BindingContext=\"{Binding Days[4]}\"/>\r\n                                <AgendaHelpers:DayCell Grid.Column=\"5\" BindingContext=\"{Binding Days[5]}\"/>\r\n                                <AgendaHelpers:DayCell Grid.Column=\"6\" BindingContext=\"{Binding Days[6]}\"/>\r\n                                \r\n                            </Grid>\r\n\r\n                        </DataTemplate>\r\n\r\n                    </Carousel:CarouselView.ItemTemplate>\r\n                </Carousel:CarouselView>\r\n\r\n    </ContentView.Content>\r\n</ContentView>\r\n````\r\n\r\nEach DayCell has a tap gesture recognizer to detect when we tap on the DayCell and when this happens, it draws a circle on this DayCell. **Problem is**, the drawing is getting made for same DayCell every 4 weeks. So if I select a day, then every 4 weeks, this same day gets selected.\r\n\r\nI'm thinking of a problem in the control on how it manages the BindingContext declaration as I do it in the XAML. **I know that this is not a problem from my code or the way a manage the 'selection' because with this https://github.com/alexrainman/CarouselView Carousel View, I do not have that problem.** \r\n\r\nDoes anyone have a clue on what I can do?\r\n\r\nFor more context, this is the code for my Weeks collection and object:\r\n\r\nWeek collection bound to the CarouselView:\r\n````\r\n        /// <summary>\r\n        /// The weeks that the agenda holds\r\n        /// </summary>\r\n        public ObservableCollection<Week> Weeks { get => _weeks; set { _weeks = value; OnPropertyChanged(nameof(Weeks)); } }\r\n\r\n````\r\n\r\nWeek object:\r\n````\r\n    public class Week\r\n    {\r\n        #region Properties\r\n\r\n        /// <summary>\r\n        /// This week's number in the year\r\n        /// </summary>\r\n        public int WeekNumber { get; set; }\r\n\r\n        /// <summary>\r\n        /// The 7 days a week must have\r\n        /// </summary>\r\n        /// <remarks>\r\n        /// TODO: Don't assign after having done bindings to this week's days, or bindings will be lost! \r\n        /// </remarks>\r\n        public List<Day> Days { get; set; }\r\n\r\n        public DateTime FirstMondayDate\r\n        {\r\n            get => _firstMondayDate;\r\n            set\r\n            {\r\n                FirstMondayNumber = value.Day;\r\n                _firstMondayDate = value;\r\n            }\r\n\r\n        }\r\n        /// <summary>\r\n        /// The number  in the month of the first day in this week\r\n        /// </summary>\r\n        /// <remarks>\r\n        /// TODO: Don't assign after having done bindings to this week's days, or bindings will be lost! \r\n        /// </remarks>\r\n        public int FirstMondayNumber\r\n        {\r\n            get { return _firstMondayNumber; }\r\n            set\r\n            {\r\n                _firstMondayNumber = value;\r\n                UpdateDays();\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        /// The number in the month of the last day in this week\r\n        /// </summary>\r\n        public int LastSundayNumber\r\n        {\r\n            get { return _lastSundayNumber; }\r\n            set\r\n            {\r\n                _lastSundayNumber = value;\r\n                UpdateDays();\r\n            }\r\n        }\r\n\r\n\r\n        #endregion\r\n    }\r\n\r\n````\r\n"},"comment":{"url":"https://api.github.com/repos/AndreiMisiukevich/CardView/issues/comments/402488331","html_url":"https://github.com/AndreiMisiukevich/CardView/issues/45#issuecomment-402488331","issue_url":"https://api.github.com/repos/AndreiMisiukevich/CardView/issues/45","id":402488331,"node_id":"MDEyOklzc3VlQ29tbWVudDQwMjQ4ODMzMQ==","user":{"login":"AndreiMisiukevich","id":10124814,"node_id":"MDQ6VXNlcjEwMTI0ODE0","avatar_url":"https://avatars3.githubusercontent.com/u/10124814?v=4","gravatar_id":"","url":"https://api.github.com/users/AndreiMisiukevich","html_url":"https://github.com/AndreiMisiukevich","followers_url":"https://api.github.com/users/AndreiMisiukevich/followers","following_url":"https://api.github.com/users/AndreiMisiukevich/following{/other_user}","gists_url":"https://api.github.com/users/AndreiMisiukevich/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreiMisiukevich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreiMisiukevich/subscriptions","organizations_url":"https://api.github.com/users/AndreiMisiukevich/orgs","repos_url":"https://api.github.com/users/AndreiMisiukevich/repos","events_url":"https://api.github.com/users/AndreiMisiukevich/events{/privacy}","received_events_url":"https://api.github.com/users/AndreiMisiukevich/received_events","type":"User","site_admin":false},"created_at":"2018-07-04T14:02:27Z","updated_at":"2018-07-04T14:02:27Z","author_association":"OWNER","body":"@Juansero29 could you please fork this repository and add the sample to your forked repo?\r\nThen send me a link to this repo.\r\nI will debug it and find the problem, then i fix it =)\r\n\r\nI hope it's easy for you)"}}
{"actor":{"display_login":"AndreiMisiukevich"}}