public void InitializeTools() { //RouteGroupColors.Overlay = (App.Current.Resources["AppBackgroundBrush"] as SolidColorBrush).Color; RouteGroup.TFactory = routeGroup => new RouteGroupColors(routeGroup); StopPicker.LoadItemSource(); #if WINDOWS_PHONE_APP Windows.Services.Maps.MapService.ServiceToken = Config.Current.MapAuthenticationToken; #endif }
public DefaultPage() { this.InitializeComponent(); this.stateManager = new PageStateManager(this); stateManager.InitializeState += InitializePage; //stateManager.RestoreState += RestorePage; App.UB.History.HistoryCleared += History_HistoryCleared; StopPicker.LoadItemsSourceTo(SourceBox, true); StopPicker.LoadItemsSourceTo(DestBox, false); DateTime time = DateTime.Now; time += TimeSpan.FromMinutes(time.Minute % 5 == 0 ? 0 : 5 - time.Minute % 5); HourBox.ItemsSource = Enumerable.Range(0, 24).ToList(); HourBox.SelectedIndex = time.Hour; MinuteBox.ItemsSource = Enumerable.Range(0, 60 / 5).Select(i => (i * 5).ToString("D2")).ToList(); MinuteBox.SelectedIndex = (int)(time.Minute / 5.0); }