我正在使用Xamarin和MVVMCross为IOS开发我的frist APP。这个APP将是一个登录视图,然后是一个菜单视图,链接到另一个视图。我使用XIB文件为屏幕流设计控件和ShowViewModel导航系统控件。我读过我需要做一个自定义演示者。
我在登录视图中隐藏了导航菜单,但我想在第二个视图中显示它,但导航菜单显示“后退”按钮,我不希望用户返回到登录视图而我想要自定义导航菜单。你能帮帮我吗?
谢谢
我使用application.cs启动viewmodel,该文件来自MvxApplication
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView theMessage = (TextView)findViewById(R.id.theMessage);
theMessage.setText(getIntent().getStringExtra("this.is.the.message"));
}
APPdelegate.cs
this.RegisterAppStart<LoginViewModel> ();
loginview
[Register ("AppDelegate")]
public class AppDelegate : MvxApplicationDelegate
{
// class-level declarations
public override UIWindow Window
{
get;
set;
}
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
Window = new UIWindow(UIScreen.MainScreen.Bounds);
var setup = new Setup(this, Window);
setup.Initialize();
var startup = Mvx.Resolve<IMvxAppStart>();
startup.Start();
Window.MakeKeyAndVisible();
return true;
}
}