protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { NavigationContext.QueryString.TryGetValue("cid", out carID); NavigationContext.QueryString.TryGetValue("fid", out fuelID); if (fuelID != null && CurrentRecord == null) { var record = from fuelInfo info in App.ViewModel.Database.fuelInfo where info.CarID == int.Parse(carID) && info.FuelID == int.Parse(fuelID) orderby info.Date ascending select info; CurrentRecord = new FuelRecord { Cost = record.FirstOrDefault().Cost.ToString(), Date = record.FirstOrDefault().DateStr, Fill = record.FirstOrDefault().Filled.ToString(), Odometer = record.FirstOrDefault().Miles.ToString() }; } else if (CurrentRecord == null) { CurrentRecord = new FuelRecord { PreciseDateTime = DateTime.Now, Date = DateTime.Now.ToShortDateString() }; } this.DataContext = CurrentRecord; ErrorLogging.Analytics(this.GetType().ToString(), "AddFuel", e.NavigationMode.ToString(), string.Empty); base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { NavigationContext.QueryString.TryGetValue("carID", out carID); NavigationContext.QueryString.TryGetValue("maintID", out maintID); LoadData(); ErrorLogging.Analytics(this.GetType().ToString(), "AddMaint", e.NavigationMode.ToString(), string.Empty); base.OnNavigatedTo(e); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { base.OnNavigatedTo(e); string cid; NavigationContext.QueryString.TryGetValue("carID", out cid); int.TryParse(cid, out carID); grid2.DataContext = this; LoadData(carID); ErrorLogging.Analytics(this.GetType().ToString(), "CarStatInfo", e.NavigationMode.ToString(), string.Empty); }
void Settings_Loaded(object sender, RoutedEventArgs e) { string distance, volume, average, currency; bool avgmethod; IsolatedStorageSettings.ApplicationSettings.TryGetValue("distance", out distance); IsolatedStorageSettings.ApplicationSettings.TryGetValue("volume", out volume); IsolatedStorageSettings.ApplicationSettings.TryGetValue("average", out average); IsolatedStorageSettings.ApplicationSettings.TryGetValue("currency", out currency); IsolatedStorageSettings.ApplicationSettings.TryGetValue("avgmethod", out avgmethod); txtDistance.Text = distance; txtVolume.Text = volume; //txtAverage.Text = average; txtCurrency.Text = currency; checkBox1.IsChecked = avgmethod; ErrorLogging.Analytics(this.GetType().ToString(), "Settings", "Loaded", string.Empty); }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { NavigationContext.QueryString.TryGetValue("id", out carID); var carsInDb = from carInfo cInfo in App.ViewModel.Database.carInfo where cInfo.CarID == int.Parse(carID) select cInfo; var selMake = carsInDb.FirstOrDefault().CarMake; var selModel = carsInDb.FirstOrDefault().CarModel; var selyear = carsInDb.FirstOrDefault().CarYear; string delmiter = " "; string selected = String.Concat(selMake, delmiter, selModel); PageTitle.Text = selected; PageTitle2.Text = selyear; listBox1.SelectedIndex = -1; ErrorLogging.Analytics(this.GetType().ToString(), "FuncMain", e.NavigationMode.ToString(), string.Empty); base.OnNavigatedFrom(e); }
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e) { ErrorLogging.Analytics(this.GetType().ToString(), "AddCar", e.NavigationMode.ToString(), string.Empty); base.OnNavigatedFrom(e); }
protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e) { // Save changes to the database. App.ViewModel.Database.SubmitChanges(); ErrorLogging.Analytics(this.GetType().ToString(), "Mainpage", e.NavigationMode.ToString(), string.Empty); }