private void ConvertMatchesToButtons(SortableObservableCollection <IMatchVw> matches, SortableObservableCollection <VFLMatchButton> vflMatchButtons)
        {
            SortableObservableCollection <VFLMatchButton> buttons = new SortableObservableCollection <VFLMatchButton>();
            int channel = 0;

            foreach (MatchVw match in matches.OrderBy(x => x.LineObject.BtrMatchId))
            {
                VFLMatchButton button = new VFLMatchButton(match.HomeCompetitorName, match.AwayCompetitorName, match.LineObject.BtrMatchId, match);
                button.Channel = channel++;
                buttons.Add(button);
            }

            if (vflMatchButtons.Count != 0)
            {
                if (buttons.Count == 0)
                {
                    vflMatchButtons.Clear();
                }

                if (vflMatchButtons[0].MatchVw.VirtualDay != buttons[0].MatchVw.VirtualDay)
                {
                    vflMatchButtons.Clear();
                }
            }
            if (vflMatchButtons.Count == 0)
            {
                foreach (var vflMatchButton in buttons)
                {
                    vflMatchButtons.Add(vflMatchButton);
                }
                vflMatchButtons.ElementAt(0).IsSelected = true;
                OnOpenVflPage(vflMatchButtons.ElementAt(0));
            }
        }
		public ScheduleZoneDetailsViewModel(Schedule schedule, Organisation organisation)
		{
			Title = "Добавить новые зоны";
			ScheduleZone = new List<ScheduleZone>();

			Zones = new SortableObservableCollection<SelectationScheduleZoneViewModel>();
			var organisationResult = OrganisationHelper.GetSingle(organisation.UID);
			_doorUIDs = organisationResult != null ? organisationResult.DoorUIDs : new List<Guid>();

			var gkDoors = GKManager.Doors.Where(x => _doorUIDs.Any(y => y == x.UID));
			foreach (var door in gkDoors)
			{
				if (door.EnterZoneUID != Guid.Empty)
				{
					var enterZone = GKManager.SKDZones.FirstOrDefault(x => x.UID == door.EnterZoneUID);
					if (enterZone != null && !Zones.Any(x => x.ZoneUID == enterZone.UID))
						Zones.Add(new SelectationScheduleZoneViewModel(enterZone, schedule, door.UID));
				}

				if (door.ExitZoneUID != Guid.Empty)
				{
					var exitZone = GKManager.SKDZones.FirstOrDefault(x => x.UID == door.ExitZoneUID);
					if (exitZone != null && !Zones.Any(x => x.ZoneUID == exitZone.UID))
						Zones.Add(new SelectationScheduleZoneViewModel(exitZone, schedule, door.UID));
				}
			}

			Zones = new ObservableCollection<SelectationScheduleZoneViewModel>(Zones.OrderBy(x => x.No)); //TODO: 
			SelectedZone = Zones.FirstOrDefault();
		}