2013-10-17 98 views
2

的AXML:获取参数命令

<Button 
android:id="@+id/greenButton" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="Green" 
local:MvxBind="Click ShowColorCommand, CommandParameter='Green'"/> 

和视图模型:

public class MainViewModel 
    : MvxViewModel 
{ 
    public ICommand ShowColorCommand 
    { 
     get 
     { 
      return new MvxCommand(() => ShowViewModel<ColorViewModel>(new { color = ??? })); 
     } 
    } 
} 

我如何读/在我的命令使用CommandParameter从.axml( '绿色') ?我需要把什么放在“???”

任何帮助表示赞赏

回答