我正在尝试在 OnInit 方法中添加基于模型的动态控件,但"The Model property is currently null, however it should have been automatically initialized by the presenter. This most likely indicates that no presenter was bound to the control. Check your presenter bindings."
出现错误。但是,如果我在 OnLoad 中添加控件,它们将无法正常工作-不会触发事件。
同样从我看到的演示者绑定发生在 InitComplete 事件中
代码:
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
this.OnLoadTitle();
foreach (var platform in Model.Title.Platforms)
{
var tab = CreateTabForPlatform(platform);
this.TabView.Tabs.Add(tab);
}
}
我该如何解决这个问题。谢谢/