Monday, March 19, 2012

Common Marketplace Tasks to Utilize in your Apps

private void button1_Click_3(object sender, System.Windows.RoutedEventArgs e)
{
MarketplaceDetailTask myTask = new MarketplaceDetailTask();
myTask.ContentType = MarketplaceContentType.Applications;
myTask.ContentIdentifier = "dc2c2c55-75a0-e011-986b-78e7d1fa76f8";
myTask.Show();
}
private void button2_Click_2(object sender, System.Windows.RoutedEventArgs e)
{
MarketplaceReviewTask myTask2 = new MarketplaceReviewTask();
myTask2.Show();
}
private void button4_Click_2(object sender, System.Windows.RoutedEventArgs e)
{
MarketplaceSearchTask myTask3 = new MarketplaceSearchTask();
myTask3.ContentType = MarketplaceContentType.Applications;
myTask3.SearchTerms = "Lankerspoon";
myTask3.Show();
 

}

Navigating to marketplace to cross market your applications

Make a button, put an image or your little sales pitch for your new application.
private void button1_Click_3(object sender, System.Windows.RoutedEventArgs e)
{
MarketplaceDetailTask myTask = new MarketplaceDetailTask();
myTask.ContentType = MarketplaceContentType.Applications;
myTask.ContentIdentifier = "dc2c2c55-75a0-e011-986b-78e7d1fa76f8";
myTask.Show();
}

Then the above code will navigate to that application. Get the ContentIdentifier from the apphub, it is the Product ID listed on the details page of the application. and off your go, rock and roll!
Nigel

Wednesday, March 14, 2012

Network Checker

Note on some phones this can lock up the UI from 5 to 30 seconds, so perform this in another thread. -- NIGEL If you just run a network check you can lock up the UI very easily.



public void nigel_network_checker()
{
Thread oThread = new Thread(new ThreadStart(check_network));
oThread.Start();
 
 
 
 
}
public void check_network()
{
//if (( PhoneNetworkApi.NetworkInterface.NetworkInterfaceType.ToString() == "None"))
//{
// textBlock3.Text += NetworkInterface.NetworkInterfaceType.ToString();
// if (NetworkInterface.GetIsNetworkAvailable() == "TRUE")
// {
// textBlock3.Text += "GetISNetwork Triggered!!!!!";
// }
// try { FrameworkDispatcher.Update(); }
//catch { }
int theresult;
 
if (NetworkInterface.NetworkInterfaceType.ToString() == "None")
{
theresult = 1;
//textbox2.Text += "No Network connection!!!";
Thread.Sleep(10);
globalstuff.GlobalVariables.networksolid = "NO";
// textBlock3.Text += "Network Check:";
// textBlock3.Text += NetworkInterface.NetworkInterfaceType.ToString();
// FadeIn(image4, 2);
//}
}
else
{
globalstuff.GlobalVariables.networksolid = "YES";
}
globalstuff.GlobalVariables.networktype = NetworkInterface.NetworkInterfaceType.ToString();
theresult = 0;
 
}