public MuseumList () { InitializeComponent (); //_service = new DataService (); var assembly = typeof(MuseumList).GetTypeInfo().Assembly; string data = String.Empty; #if __ANDROID__ data = "MuseumsPlan.Droid."; #elif __IOS__ #endif Stream stream = assembly.GetManifestResourceStream(data + "Data.Museum.json"); string text = ""; foreach (var res in assembly.GetManifestResourceNames()) System.Diagnostics.Debug.WriteLine("found resource: " + res); using (var reader = new StreamReader (stream)) { text = reader.ReadToEnd (); } _service = new DataService (text); ListMuseums = _service.GetMuseums (); ListViewMuseum.ItemsSource = ListMuseums; ListViewMuseum.RowHeight = 70; }
public MuseumDetails(string name, DataService service) { InitializeComponent (); _service = service; BindingContext = _service.GetMuseumByName (name); }