イベント(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);
}