MvvmCross流畅的事件绑定(iOS)。我怎么得到事件的参数?

时间:2017-01-12 10:26:26

标签: xamarin.ios mvvmcross

如何使用流畅的绑定类型绑定到事件并将参数设置到我的ViewModel?

示例:

    set.Bind(SegmentControl).For("ValueChanged").To(vm => vm.SegmentControlValueChanged);

//--------- View Model:

   public MvxAsyncCommand<object> SegmentControlValueChanged
    {
        get
        {
            return new MvxAsyncCommand<object>(async obj =>
            {
               //obj alwais is null
               return;
            });
        }
    }

如何获取发件人或其他参数(例如EventArgs)?

如何使用MvxAsyncCommand以及何时使用?

1 个答案:

答案 0 :(得分:0)

尝试在simplify([m(2,2,[v(1,a)]),m(2,2,[v(1,a)])],R). R = [m(4, 2, [v(1, a)])]. 之后添加CommandParamter

To

https://github.com/MvvmCross/MvvmCross/blob/8a824c797747f74716fc64c2fd0e8765c29b16ab/MvvmCross/Core/Binding/BindingContext/MvxFluentBindingDescription.cs