如何使用事件导航回来(比如说 Tapped for String 元素)?以编程方式
Section s = someelement.Parent as Section;
RootElement re = s.Parent as RootElement;
// how to get to DialogViewControler or something to navigate back?
谢谢
梅尔
如何使用事件导航回来(比如说 Tapped for String 元素)?以编程方式
Section s = someelement.Parent as Section;
RootElement re = s.Parent as RootElement;
// how to get to DialogViewControler or something to navigate back?
谢谢
梅尔
这里很新,但您不想使用NavigationController
来做到这一点吗?我猜你DialogViewController
在你的活动实施的地方?所以你可以这样做:
this.NavigationController.PopViewControllerAnimated(true);
如果您的 DVC 在 NavController 中,Baramuse 的答案将起作用。但是 MTD 可以在导航控制器样式和模式对话框样式中使用。你最好让 MTD 为你工作(所以如果将来有任何变化,你的代码仍然可以工作)。仅提供DialogViewController
方法:
/// <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);
}