I’m creating my own handler method and I want to know how to implement a Bundle parameter that is optional.
In Android it would look like
public bool updateUI(int mode, Bundle... params)
{
switch (mode)
{
case 0: return doStuff(params.getString("Name"));
default: break;
}
}
This is not covered in the migration guide.
How to use Named and Optional arguments in .NET Framework and in Windows Phone as well:
http://msdn.microsoft.com/en-us/library/dd264739.aspx
Or you can use the params keyword fore passing arbitrary number of arguments:
http://msdn.microsoft.com/en-us/library/w5zay9db(v=VS.100).aspx
Edit: not sure, how the Bundle actually works, but it looks like a generic container for data. You might try to use dynamic type and the ExpandoObject:
http://msdn.microsoft.com/en-us/library/system.dynamic.expandoobject(v=vs.95).aspx
What are the true benefits of ExpandoObject?