public DetailsPage()
            : base()
        {
            InitializeComponent();
            base.Initialize();

            this.Loaded += new RoutedEventHandler(DetailsPage_Loaded);
            this.Unloaded += new RoutedEventHandler(DetailsPage_Unloaded);
            this.BackKeyPress += new EventHandler<System.ComponentModel.CancelEventArgs>(DetailsPage_BackKeyPress);

            appbar_favorite = ((ApplicationBarIconButton)ApplicationBar.Buttons[0]);

            viewModel = Resources["ViewModel"] as RouteDetailsVM;

            busArrivalUpdateTimer = new DispatcherTimer();
            busArrivalUpdateTimer.Interval = new TimeSpan(0, 0, 0, 30, 0); // 30 secs
            busArrivalUpdateTimer.Tick += new EventHandler(busArrivalUpdateTimer_Tick);

            this.ApplicationBar.ForegroundColor = ((SolidColorBrush)Application.Current.Resources["OBAForegroundBrush"]).Color;
            // the native theme uses a shade of "gray" that is actually white or black with an alpha mask.
            // the appbar needs to be opaque.
            ColorAlphaConverter alphaConverter = new ColorAlphaConverter();
            SolidColorBrush appBarBrush = (SolidColorBrush)alphaConverter.Convert(
                                                            Application.Current.Resources["OBADarkBrush"],
                                                            typeof(SolidColorBrush),
                                                            Application.Current.Resources["OBABackgroundBrush"],
                                                            null
                                                            );

            this.ApplicationBar.BackgroundColor = appBarBrush.Color;

            #if SCREENSHOT
            SystemTray.IsVisible = false;
            #endif
        }
示例#2
0
 public StopsForRouteCompleted(RouteDetailsVM viewModel, ArrivalAndDeparture arrival, Action uiCallback)
 {
     this.viewModel  = viewModel;
     this.arrival    = arrival;
     this.uiCallback = uiCallback;
 }
 public StopsForRouteCompleted(RouteDetailsVM viewModel, ArrivalAndDeparture arrival, Action uiCallback)
 {
     this.viewModel = viewModel;
     this.arrival = arrival;
     this.uiCallback = uiCallback;
 }