Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto ICommands #301

Closed
slodge opened this issue Jun 6, 2013 · 4 comments
Closed

Auto ICommands #301

slodge opened this issue Jun 6, 2013 · 4 comments
Labels
t/feature Feature request type

Comments

@slodge
Copy link
Contributor

slodge commented Jun 6, 2013

The binding layer could automatically allow command/action binding to:

  public void DoSomething()
  {
      // code
  }

  public void DoSelect(MyListItem selected)
  {
      // code
  }

It could automatically create an ICommand wrapper for these methods, allowing binding like:

  local:mvxBind="Click DoSomething"

or

  local:mvxBind="ItemsSource Items; ItemClick DoSelect"
@dhilgarth
Copy link

What rules would apply for the DoSelect scenario? How would the runtime know what value it should pass as selected?

@slodge
Copy link
Contributor Author

slodge commented Jul 3, 2013

This is normally determined by the view or by the binding itself.

eg see https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding.Droid/Views/MvxListView.cs#L102

There is an option to add a fixed command parameter - there's a blog post on this (sorry - on mobile so too hard to find link right now)

@slodge
Copy link
Contributor Author

slodge commented Jul 18, 2013

documented in video and N+1 sample now... as well as in wiki entry... so closing

@slodge slodge closed this as completed Jul 18, 2013
@dhilgarth
Copy link

The N+1 video is here: http://www.youtube.com/watch?v=8-5XQlcVj2Y#t=1071.
The link starts the video at the appropriate time. Before that, FieldBinding is explained.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t/feature Feature request type
Development

No branches or pull requests

2 participants