public ViewRoute() { InitializeComponent(); MapPreview.CartographicMode = App.UserSettings.GetSetting<MapCartographicMode>("MapCartographicMode", MapCartographicMode.Road); MapPreview.ColorMode = App.UserSettings.GetSetting<MapColorMode>("MapColorMode", MapColorMode.Light); _miscFunctions = new MiscFunctions(); _fileIo = new FileIO(); _trackDb = new TrackDataContext(TrackDataContext.DBConnectionString); MapPreview.DoubleTap += MapPreview_DoubleTap; }
/// <summary> /// /// </summary> public Save() { InitializeComponent(); _fileIO = new FileIO(); _ser = new Serializer(); _trackDB = new TrackDataContext(TrackDataContext.DBConnectionString); // Data context and observable collection are children of the main page. DataContext = this; // Define the query to gather all of the to-do items. var tracksInDB = from TrackDataBase trk in _trackDB.TrackTable select trk; // Execute the query and place the results into a collection. TrackDataBases = new ObservableCollection <TrackDataBase>(tracksInDB); SystemTray.SetIsVisible(this, true); _prog = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, _prog); }
//Constructor public TracksPiv() { _miscFunctions = new MiscFunctions(); _unitConversions = new UnitConversions(); _fileio = new FileIO(); _mapUnitIndex = App.UserSettings.GetSetting(AppResources.UserSettingsMapUnits, 0); _loc = new LocationManager(); _trackDb = new TrackDataContext(TrackDataContext.DBConnectionString); DataContext = this; InitializeComponent(); BuildLocalizedApplicationBar(); SystemTray.SetIsVisible(this, true); _prog = new ProgressIndicator(); SystemTray.SetProgressIndicator(this, _prog); App.Timer.timer.Tick += Timer_Tick; }
/// <summary> /// Constructor for the Application object. /// </summary> public App() { // Global handler for uncaught exceptions. UnhandledException += Application_UnhandledException; // Standard XAML initialization InitializeComponent(); // Phone-specific initialization InitializePhoneApplication(); // Language display initialization InitializeLanguage(); // Show graphics profiling information while debugging. if (Debugger.IsAttached) { // Display the current frame rate counters. Application.Current.Host.Settings.EnableFrameRateCounter = true; // Show the areas of the app that are being redrawn in each frame. //Application.Current.Host.Settings.EnableRedrawRegions = true; // Enable non-production analysis visualization mode, // which shows areas of a page that are handed off to GPU with a colored overlay. //Application.Current.Host.Settings.EnableCacheVisualization = true; // Prevent the screen from turning off while under the debugger by disabling // the application's idle detection. // Caution:- Use this under debug mode only. Application that disables user idle detection will continue to run // and consume battery power when the user is not using the phone. PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; } using (TrackDataContext db = new TrackDataContext(TrackDataContext.DBConnectionString)) { if (db.DatabaseExists() == false) { //Create the database db.CreateDatabase(); } } //Initialize user settings. MapFunctions = new MapFunctions(); UserSettings = new Settings(); Timer = new Timer(); TimerMoving = new Timer(); TimerMoving.timer.Tick += Timer_Tick; TimerMoving.StartTimer(); CompasSensor = new CompasSensor(); if (Compass.IsSupported) { Compass.CurrentValueChanged += new EventHandler <SensorReadingEventArgs <CompassReading> >(compass_CurrentValueChanged); Compass.Start(); } //LicenseInformation license = new LicenseInformation(); //IsTrial = license.IsTrial(); switch (DeviceStatus.PowerSource) { case PowerSource.Battery: PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Enabled; break; case PowerSource.External: PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled; break; } }