コード例 #1
0
 public StationPage()
 {
     InitializeComponent();
     CommonApplicationBarItems.Init(this);
     if (Stations.Country.SupportsArrivals)
     {
         mapIndex = 2;
     }
     else
     {
         pivot.Items.Remove(arrivalsPivotItem);
     }
     pivot.SelectionChanged += OnPivotSelectionChanged;
 }
コード例 #2
0
        public MainAndFilterPage()
        {
            InitializeComponent();
            var allStationsView = new CollectionViewSource {
                Source = Stations.GetAll()
            }.View;

            allStationsView.Filter  = x => Filter(filter.Text, fromStation, excludeStation, (Station)x);
            allStations.ItemsSource = allStationsView;
            Observable.FromEvent <TextChangedEventArgs>(filter, "TextChanged")
            .Throttle(TimeSpan.FromMilliseconds(300))
            .Subscribe(_ => Dispatcher.BeginInvoke(() => allStationsView.Refresh()));
            Observable.FromEvent <KeyEventArgs>(filter, "KeyDown")
            .Where(x => x.EventArgs.Key == Key.Enter)
            .Subscribe(_ => Dispatcher.BeginInvoke(() =>
            {
                var stations = allStationsView.Cast <Station>().ToArray();
                if (stations.Length == 1)
                {
                    GoToStation(stations[0]);
                }
            }));
            CommonApplicationBarItems.Init(this);
        }
コード例 #3
0
 public LiveProgressPage()
 {
     InitializeComponent();
     CommonApplicationBarItems.Init(this);
 }