private async void Pin_MarkerClicked(object sender, PinClickedEventArgs e) { Pin buf = sender as Pin; ConnectionWithDataBase db = Search(buf); string s = $"https://archi.ru/projects/world/{db.index}"; Obj obj1 = new Obj(s, buf, db.image); DetailPage detailPage = new DetailPage(obj1); //detailPage.BindingContext = obj1; await Navigation.PushModalAsync(detailPage); }
/* * public string[] AuthorAndName(string s) * { * return s.Split("\n\n"); * } */ public List <ConnectionWithDataBase> Parse() { List <ConnectionWithDataBase> connect = new List <ConnectionWithDataBase>(); foreach (string[] s in this.data) { ConnectionWithDataBase buf = new ConnectionWithDataBase(int.Parse(s[2]), double.Parse(s[0], CultureInfo.InvariantCulture), double.Parse(s[1], CultureInfo.InvariantCulture), s[5], s[3], s[4]); connect.Add(buf); } return(connect); }
public ConnectionWithDataBase Search(Pin pin) { string jsonString = FileReader(); var data = JsonConvert.DeserializeObject <Data>(jsonString); List <ConnectionWithDataBase> connection = data.Parse(); Position position = pin.Position; ConnectionWithDataBase result = new ConnectionWithDataBase(); foreach (ConnectionWithDataBase db in connection) { if (db.x == position.Latitude) { result = db; break; } } return(result); }