protected override void OnAppearing() { base.OnAppearing(); SQLiteConnection dbconn; try { dbconn = new SQLiteConnection(App.settingpath); var info = dbconn.Table <settingsdata>().ToList().First(); lang = info.language; List <weatherkey> showdata = new DB_weather().WeatherInfo; { weatherchart.SecondaryAxis.LabelStyle.LabelFormat = "##.#" + DB_weather.tempunit(info._temp); if (info._temp == temp.Fahrenheit) { foreach (var item in showdata) { item.MaxTemp_level = DB_weather.celtofah(item.MaxTemp_level); item.MinTemp_level = DB_weather.celtofah(item.MinTemp_level); } } maxtempdata.ItemsSource = showdata; maxtempdata.YBindingPath = "MaxTemp_level"; maxtempdata.XBindingPath = "date"; mintempdata.ItemsSource = showdata; mintempdata.YBindingPath = "MinTemp_level"; mintempdata.XBindingPath = "date"; var p = (int)lang; showRecordbtn.Text = text[0][p]; weatherchart.Title.Text = text[1][p]; weatherchart.SecondaryAxis.Title.Text = text[2][p]; weatherchart.PrimaryAxis.Title.Text = text[3][p]; chart0.Title.Text = text[4][p]; chart0.SecondaryAxis.Title.Text = text[5][p]; chart0.PrimaryAxis.Title.Text = text[3][p]; chart1.Title.Text = text[6][p]; chart1.SecondaryAxis.Title.Text = text[7][p]; chart1.PrimaryAxis.Title.Text = text[3][p]; chart2.Title.Text = text[8][p]; chart2.SecondaryAxis.Title.Text = text[9][p]; chart2.PrimaryAxis.Title.Text = text[3][p]; chart3.Title.Text = text[10][p]; chart3.SecondaryAxis.Title.Text = text[11][p]; chart3.PrimaryAxis.Title.Text = text[3][p]; chart4.Title.Text = text[12][p]; chart4.SecondaryAxis.Title.Text = text[13][p]; chart4.PrimaryAxis.Title.Text = text[3][p]; chart5.Title.Text = text[14][p]; chart5.SecondaryAxis.Title.Text = text[15][p]; chart5.PrimaryAxis.Title.Text = text[3][p]; chart6.Title.Text = text[16][p]; chart6.SecondaryAxis.Title.Text = text[17][p]; chart6.PrimaryAxis.Title.Text = text[3][p]; Title = text[18][p]; } } catch (Exception) { } }
protected override void OnAppearing() { base.OnAppearing(); SQLiteConnection dbconn = new SQLiteConnection(App.settingpath); var info = dbconn.Table <settingsdata>().ToList().First(); lang = info.language; try { weatherchart.SecondaryAxis.LabelStyle.LabelFormat = "##.#" + DB_weather.tempunit(info._temp); List <weatherDB> showdata = new SQLiteConnection(App.futureweatherDBpath) .Table <weatherDB>().ToList(); if (info._temp == temp.Fahrenheit) { foreach (var item in showdata) { item.maxtemp = DB_weather.celtofah(item.maxtemp); item.mintemp = DB_weather.celtofah(item.mintemp); } } maxtempdata.ItemsSource = showdata; maxtempdata.YBindingPath = "maxtemp"; maxtempdata.XBindingPath = "date"; mintempdata.ItemsSource = showdata; mintempdata.YBindingPath = "mintemp"; mintempdata.XBindingPath = "date"; } catch (Exception) { } int p = (int)lang; Title = weathertext[p]; weatherchart.Title.Text = temptitle[p]; weatherchart.SecondaryAxis.Title.Text = tempyaxis[p]; weatherchart.PrimaryAxis.Title.Text = tempxaxis[p]; humchart.Title.Text = humtitle[p]; humchart.SecondaryAxis.Title.Text = humyaxis[p]; humchart.PrimaryAxis.Title.Text = tempxaxis[p]; }