Bind Button to start other Activity on Mvvmcross
首先,我使用Xamarin,Visual Studio和Mvvmcross。
我的其中一个标签上的
是3个按钮。每个人都开始一个新的活动。我的问题是我必须如何绑定此Button,更有趣的是该命令如何看起来以启动新的Activity。我的问题不是按钮与命令的绑定。它如何从ViewModel启动另一个Activity。
我可以将按钮绑定到命令,例如保存数据或其他东西。但所有人都认为可以在" Buisnesslayer"上使用
thx和问候
在您的视图模型中,您将具有如下所示的ICommand:
1 2 3 4 | public ICommand GoSimpleCommand { get { return new MvxCommand(() => ShowViewModel<SimpleViewModel>()); } } |
请参阅此处的导航示例。