public static CustomProgressDialog CreateDialog(Context context)
{
customProgressDialog = new CustomProgressDialog(context, Resource.Style.CustomProgressDialog);
//set the view
customProgressDialog.SetContentView(Resource.Layout.loading);
//set the gravity
customProgressDialog.Window.Attributes.Gravity = GravityFlags.Center;
return customProgressDialog;
}