未处理的异常
系统收藏。通用的KeyNotFoundException
:
未在中配置类型MvxSidebarPresentationAttribute
演示者词典
-
MvvmCros 5.6工具
-
Visual studio 2015
-
Windows 8.1
-
iPhone 7模拟器iOS 10.3
密码
菜单视图
[MvxFromStoryboard("Main")]
[MvxSidebarPresentation(MvxPanelEnum.Left, MvxPanelHintType.PushPanel, false)]
public partial class MenuViewController : MvxViewController<MenuViewModel>
{
public MenuViewController(IntPtr handle) : base(handle)
{
}
public MenuViewController() : base("MenuViewController", null)
{
}
public override void DidReceiveMemoryWarning()
{
// Releases the view if it doesn't have a superview.
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
var set = this.CreateBindingSet<MenuViewController, MenuViewModel>();
set.Bind(btnFirst).To(vm => vm.GotoFirstView);
set.Bind(btnSecond).To(vm => vm.GotoSecondView);
set.Apply();
// Perform any additional setup after loading the view, typically from a nib.
}
}
第一视图
[MvxFromStoryboard("Main")]
[MvxSidebarPresentation(MvxPanelEnum.Center, MvxPanelHintType.ResetRoot, true)]
public partial class FirstViewController : MvxViewController<FirstViewModel>
{
public FirstViewController() : base("FirstViewController", null)
{
}
public FirstViewController(IntPtr handle) : base(handle)
{
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
}
}
第二视图
[MvxFromStoryboard("Main")]
[MvxSidebarPresentation(MvxPanelEnum.Center, MvxPanelHintType.ResetRoot, true)]
public partial class SecondViewController : MvxViewController<SecondViewModel>
{
public SecondViewController() : base("SecondViewController", null)
{
}
public SecondViewController(IntPtr handle) : base(handle)
{
}
public override void DidReceiveMemoryWarning()
{
base.DidReceiveMemoryWarning();
// Release any cached data, images, etc that aren't in use.
}
public override void ViewDidLoad()
{
base.ViewDidLoad();
// Perform any additional setup after loading the view, typically from a nib.
}
}
我在ios项目中使用了上述代码,但它只是在ouptut中显示错误为
未处理的异常
系统收藏。通用的KeyNotFoundException:
未在presenter字典中配置类型MvxSidebarPresentationAttribute