Baramuse's answer will work IF your DVC is within a NavController. But MTD works in both a nav controller style and modal dialog style. Your better off letting MTD do that work for you (so if anything changes in the future your code will still work). The DialogViewController
provides just the method:
/// <summary>
/// Dismisses the view controller. It either pops or dismisses
/// based on the kind of container we are hosted in.
/// </summary>
public void DeactivateController (bool animated)
{
var parent = ParentViewController;
var nav = parent as UINavigationController;
if (nav != null)
nav.PopViewControllerAnimated (animated);
else
DismissModalViewControllerAnimated (animated);
}