示例#1
0
        private void ClearSelectedSports(bool res)
        {
            Dispatcher.Invoke(() =>
            {
                SportsBarItemsLive.Clear();
            });
            SelectedDescriptors.Clear();
            Dispatcher.Invoke(() =>
            {
                SportsBarItemsLive.Add(
                    new SportBarItem(
                        TranslationProvider.Translate(MultistringTags.ALL_SPORTS) as
                        string, SportSr.ALL_SPORTS));
            });
            SportsBarItemsLive.ElementAt(0).IsChecked = true;
            ChangeTracker.LiveSelectedAllSports       = true;
            SelectedDescriptors.Add(SportsBarItemsLive.ElementAt(0).SportDescriptor);

            GetSportsBarScrollviewer();

            if (scrollViewerLive == null)
            {
                return;
            }

            Dispatcher.BeginInvoke(() =>
            {
                if (ChangeTracker.IsLandscapeMode)
                {
                    scrollViewerLive.ScrollToVerticalOffset(0);
                }
                else
                {
                    scrollViewerLive.ScrollToHorizontalOffset(0);
                }
            });
        }
示例#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);
            }
        }
示例#3
0
 private void ScrollViewer_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
 {
     System.Windows.Controls.ScrollViewer scv = (System.Windows.Controls.ScrollViewer)sender;
     scv.ScrollToHorizontalOffset(scv.HorizontalOffset - e.Delta / 4);
     e.Handled = true;
 }