2016-03-22 6 views

Antwort

2

Werfen Sie einen Blick auf die MvxFromStoryboard Attribut, wie https://forums.xamarin.com/discussion/45253/cross-platform-development-with-mvvmcross

// Will look for a UIViewController with identifier "MyView" inside a Storyboard named "MyView.storyboard" 
[MvxFromStoryboard] 
public class MyView : MvxViewController 
{ 
    public MyView(IntPtr handle) : base(handle) {} 
} 

// Will look for a UIVIewController with identifier "MyOtherViewInSameStoryboard" inside a Storyboard named "MyView.storyboard" 
[MvxFromStoryboard(StoryboardName = "MyView")] 
public class MyOtherViewInSameStoryboard : MvxViewController 
{ 
    public MyOtherViewInSameStoryboard(IntPtr handle) : base(handle) {} 
} 

Die ViewModel ist mit dem ViewController über eine Namenskonvention hier gezeigt.

XYZ Ansichtsmodell ~>XYZ Viewcontroller