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

            // It is the first launch of the app if this key doesn't exist.  Otherwise we are returning
            // to the main page after tombstoning and showing the splash screen looks bad
            if (PhoneApplicationService.Current.State.ContainsKey("ShowLoadingSplash") == false)
            {
                ShowLoadingSplash();
            }

            viewModel = aViewModel as MainPageVM;
            firstLoad = true;
            navigatedAway = false;
            navigationLock = new Object();

            this.Loaded += new RoutedEventHandler(MainPage_Loaded);

            SupportedOrientations = SupportedPageOrientation.Portrait;

            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;
        }
Exemplo n.º 2
0
 public SearchByStopCompleted(SearchByStop_Callback callback, IBusServiceModel busServiceModel, MainPageVM viewModel)
 {
     this.callback        = callback;
     this.busServiceModel = busServiceModel;
     this.viewModel       = viewModel;
 }
 public MainPageVmTests()
 {
     fakeData = FakeData.Singleton;
     viewModel = new MainPageVM();
 }
 public SearchByStopCompleted(SearchByStop_Callback callback, IBusServiceModel busServiceModel, MainPageVM viewModel)
 {
     this.callback = callback;
     this.busServiceModel = busServiceModel;
     this.viewModel = viewModel;
 }