Пример #1
0
        public override void OnNavigationCompleted()
        {
            Mediator.SendMessage(true, MsgTag.ActivateForwardSelected);
            Mediator.SendMessage <bool>(true, MsgTag.ShowResultFilters);
            Mediator.Register <bool>(this, ResetSportBar, MsgTag.ClearSelectedSports);

            Results.Clear();
            SportsBarItems.Clear();
            FillResults();

            timer.Tick += timer_Elapsed;
            timer.Start();
            ChangeTracker.SelectedResults = true;

            SportsBarItems.Add(new SportBarItem(TranslationProvider.Translate(MultistringTags.ALL_SPORTS) as string, SportSr.ALL_SPORTS));
            FillSportsBar();
            if (ChangeTracker.SelectedDescriptors.Count == 0)
            {
                ChangeTracker.SelectedDescriptors.Add(SportsBarItems.ElementAt(0).SportDescriptor);
                SportsBarItems.ElementAt(0).IsChecked = true;
            }
            else
            {
                var arraycopy = ChangeTracker.SelectedDescriptors.ToArray();
                ChangeTracker.SelectedDescriptors.Clear();
                foreach (var selectedDescriptor in arraycopy)
                {
                    var sport = SportsBarItems.FirstOrDefault(x => x.SportDescriptor == selectedDescriptor);
                    sport.IsChecked = true;
                    CheckedExecute(sport);
                }
            }

            base.OnNavigationCompleted();
            Mediator.SendMessage <bool>(true, MsgTag.UpdateLiveMonitorTemplates);
            CheckSportBarButtons();
        }
Пример #2
0
        private void ResetSportBar(bool res)
        {
            SportsBarItems.Clear();
            ChangeTracker.SelectedDescriptors.Clear();
            SportsBarItems.Add(new SportBarItem(TranslationProvider.Translate(MultistringTags.ALL_SPORTS) as string, SportSr.ALL_SPORTS));
            SportsBarItems.ElementAt(0).IsChecked = true;
            ChangeTracker.SelectedDescriptors.Add(SportsBarItems.ElementAt(0).SportDescriptor);

            GetSportsBarScrollviewer();

            if (scrollViewer == null)
            {
                return;
            }

            if (ChangeTracker.IsLandscapeMode)
            {
                scrollViewer.ScrollToVerticalOffset(0);
            }
            else
            {
                scrollViewer.ScrollToHorizontalOffset(0);
            }
        }