次のような階層があります。
NavigationController
最初にプッシュ
ViewController
-ViewDidDisappear
次のビューに移動するときに正しく起動しますDialogViewController
リストを持つプッシュ-ViewDidDisappear
次へ移動するときに発火各リストは新しいファイルを開きます
DialogViewController
-ViewDidDisappear
ファイルはありませんこれには別のボタンを開くボタンがいくつかあります
DialogViewController
-VidDidDisappear
決して発火しません
コード:
public partial class CustomDialogController : DialogViewController {
public CustomDialogController() : base (UITableViewStyle.Grouped, null, true) {
}
public override void ViewDidDisappear (bool animated)
{
base.ViewDidDisappear (animated);
Console.WriteLine("Gone baby 2");
// Never Fires
}
}
public partial class WorkoutsView : DialogViewController
{
public override void ViewDidDisappear (bool animated)
{
base.ViewDidDisappear (animated);
Console.WriteLine("Gone baby");
// Here is where you can add your custom code for when the DialogViewController disappears
}
public WorkoutsView (MetaFitness.BL.MetaFitnessManager manager) : base (UITableViewStyle.Grouped, null, true)
{
this.Title ="Title";
WorkoutViewModel WorkoutDetail = new WorkoutViewModel();
//var bc = new BindingContext (this, WorkoutDetail, "Details");
//detailView = new DialogViewController(bc.Root,true);
List<Workout> workouts = manager.GetWorkouts ();
var abc = new CustomDialogController();
abc.Root = new RootElement("WorkoutsView");
Root = abc.Root;
Section section = new Section ("Workouts");
foreach (var wo in workouts) {
string name = string.Empty;
CustomDialogController WorkoutController = new CustomDialogController();
WorkoutController.Root = new RootElement(wo.Name);
RootElement wSection = WorkoutController.Root;
var s2 = new Section();
var mvm2 = new MeasurementViewModel();
// the code for this is similar to CustomDialogController - never fires
s2.Add(new MeasurementViewController(mvm2).Root);
wSection.Add (s2);
section.Add(wSection);
}
Root.Add(section);
}
}