Exemplo n.º 1
0
        void SetOpenDays()
        {
            int count = 0;

            var daysOfWeek = new [] {
                "monday".LocalizedString("Monday"),
                "tuesday".LocalizedString("Tuesday"),
                "wednesday".LocalizedString("Wednesday"),
                "thursday".LocalizedString("Thursday"),
                "friday".LocalizedString("Friday"),
                "saturday".LocalizedString("Saturday"),
                "sunday".LocalizedString("Sunday")
            };

            if (viewModel.Place.OpeningHours == null ||
                viewModel.Place.OpeningHours.WeekdayText == null ||
                viewModel.Place.OpeningHours.WeekdayText.Count == 0)
            {
                OpenHoursCell.Hidden = true;
                return;
            }

            foreach (var view in OpenHoursCell.ContentView)
            {
                ((OpenHoursView)view).DayLabel.Text   = daysOfWeek[count];
                ((OpenHoursView)view).HoursLabel.Text = viewModel.GetTime(viewModel.Place.OpeningHours.WeekdayText[count]);
                count++;
            }
        }