C# Do something after a void is loaded
<p>I try to use data after I downloaded it from an API. Example of my code:</p>

<pre><code>private int id;
public MainPage()
{
    InitializeComponent();
    SomeFunction();
}
public void SomeFunction()
{
    DownloadFromAPI("url to api");
    MessageBox.Show(id.ToString());  //&lt;&lt; Returns 0
}
public void DownloadFromAPI(DownloadStringCompletedEventArgs url)
{
    //code to retrieve data (singel id)
    id = Int16.Parse(data);
    MessageBox.Show(id.ToString());  //&lt;&lt; Returns the correct number, like 14
    test();
}
private void test()
{
    MessageBox.Show(id.ToString());  //&lt;&lt; Even Returns the correct number 14 
}
</code></pre>

<p>How is it possible to load the id information after <code>DownloadFromAPI("url to api");</code> is finished. so i get the right number (14) instead of 0?</p>
