c# - async on page load in xamarin.forms -


i'm developping small application based on master detail template. 1 of pages requires data loaded immediatly, , dont know how this. in every example, data loaded once user press button.

here current code :

string test = async (sender, e) => {      task<string> json = getrandomrelations ();     return await json; }; 

and method

public async task<string> getrandomrelations () {          var client              = new system.net.http.httpclient ();         client.baseaddress      = new uri("http://127.0.0.1/loltools/web/app_dev.php/api/relation/");         string response         = await client.getstringasync("random/20");          return response;     } 

i'm trying json response, cannot manage that... main problem cannot convert lambda expression string...

thanks !

i'm not absolutely sure trying what's wrong simply:

string test = await getrandomrelations (); 

Comments

Popular posts from this blog

c++ - Delete matches in OpenCV (Keypoints and descriptors) -

java - Could not locate OpenAL library -

sorting - opencl Bitonic sort with 64 bits keys -