/// <summary> /// Creates and adds a few ItemViewModel objects into the Items collection. /// </summary> public void LoadData() { // Sample data; replace with real data /*this.Items.Add(new ItemViewModel() { LineOne = "runtime one", LineTwo = "Maecenas praesent accumsan bibendum", LineThree = "Facilisi faucibus habitant inceptos interdum lobortis nascetur pharetra placerat pulvinar sagittis senectus sociosqu" }); * this.Items.Add(new ItemViewModel() { LineOne = "runtime two", LineTwo = "Dictumst eleifend facilisi faucibus", LineThree = "Suscipit torquent ultrices vehicula volutpat maecenas praesent accumsan bibendum dictumst eleifend facilisi faucibus" }); * */ this.List_Items.Clear(); Visibility darkBackgroundVisibility = (Visibility)Application.Current.Resources["PhoneDarkThemeVisibility"]; Table = DB_Helper.getAllRows(); // List<Pushpin> pushpin = new List<Pushpin>(); for (int i = 0; i < Table.Count(); i++) { if (darkBackgroundVisibility == Visibility.Visible) { this.List_Items.Add(new ItemViewModel() { LineOne = Table[i].Title, LineTwo = Table[i].Radius.ToString(), LineThree = Table[i].Icon_Source_Dark, LineFour = Table[i].Ring_Tones }); } else { this.List_Items.Add(new ItemViewModel() { LineOne = Table[i].Title, LineTwo = Table[i].Radius.ToString(), LineThree = Table[i].Icon_Source_Light, LineFour = Table[i].Ring_Tones }); } } this.IsDataLoaded = true; }
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { #region Trial Mode Check //if (App.IsTrial == true) //{ // // enable ads // adControl.Visibility = System.Windows.Visibility.Visible; // //adControl.IsAutoRefreshEnabled = true; // adControl.IsEnabled = true; // adControl.IsAutoCollapseEnabled = false; //} //else //{ // // disables ads // adControl.Visibility = System.Windows.Visibility.Collapsed; // //adControl.IsAutoRefreshEnabled = false; // adControl.IsEnabled = false; // adControl.IsAutoCollapseEnabled = false; //} #endregion Table = DB_Helper.getAllRows(); if (NavigationContext.QueryString["from"] == "map") { Location.Visibility = Visibility.Collapsed; Location_Text.Visibility = Visibility.Collapsed; useMyLocation.Visibility = Visibility.Collapsed; if (NavigationContext.QueryString["page"] == "new") { longitude = Double.Parse(NavigationContext.QueryString["longitude"]); latitude = Double.Parse(NavigationContext.QueryString["latitude"]); new_page = true; Title_New.Visibility = Visibility.Visible; } else { Title_Edit.Visibility = Visibility.Visible; String title = NavigationContext.QueryString["title"]; Edit_Query = DB_Helper.getRowsbyTitle(title); Title.Text = title; Radius.Text = Edit_Query[0].Radius.ToString(); Type.SelectedItem = Edit_Query[0].Type; if (Edit_Query[0].Ring_Tones != "") { Ring_Tones.SelectedItem = Edit_Query[0].Ring_Tones; } latitude = Edit_Query[0].latitude; longitude = Edit_Query[0].longitude; Note.Text = Edit_Query[0].Note; old_title = title; old_radius = Edit_Query[0].Radius.ToString(); old_type = Edit_Query[0].Type; old_ringtones = Edit_Query[0].Ring_Tones; old_note = Edit_Query[0].Note; change_UI(Edit_Query[0].Type); } } else { new_page = true; Title_New.Visibility = Visibility.Visible; longitude = Double.Parse(NavigationContext.QueryString["longitude"]); latitude = Double.Parse(NavigationContext.QueryString["latitude"]); } if (new_page) { var b = (ApplicationBarIconButton)ApplicationBar.Buttons[2]; //indx based! b.IsEnabled = false; } // Call the base method. base.OnNavigatedTo(e); }