Get Network Info on Windows Phone

When you are developing your application, you keep in mind that you may not always have a network connection. You should prepare for this simi-connected environment.  To do this, you should use the Microsoft.Phone.Net.NetworkingInformation namespace. With this you can do things like, check to see if the network is available, determine the type of network the phone is using (CDMA, GSM), or find the MO (Mobile Operator)

bool IsConnected =
string MobileOperator = 
bool IsCellularDataEnabled = 
Microsoft.Phone.Net.NetworkInformation. DeviceNetworkInformation.IsCellularDataEnabled;
bool IsCellularDataRoamingEnabled = 
Microsoft.Phone.Net.NetworkInformation DeviceNetworkInformation.IsCellularDataRoamingEnabled;
bool IsWifiEnabled =
Microsoft.Phone.Net.NetworkInformation. DeviceNetworkInformation.IsWiFiEnabled;


The NetworkInterfaceType is another good one to put to determine what type of speeds you are going to get.