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

Bind to method #25

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Bind to method #25

wants to merge 2 commits into from

Conversation

halllo
Copy link
Contributor

@halllo halllo commented Nov 11, 2015

How do you like to be able to write

<Button Command="{c:Binding ClickMethod()}"/>

when your ViewModel looks just like this:

public class ExampleViewModel : BaseViewModel
{
    public void ClickMethod()
    {
        ...
    }

@Alex141
Copy link
Owner

Alex141 commented Mar 2, 2016

Hello, Halllo!

Sorry for so lately response, I want to thank you for your pull request, it is really good job, and I saw it. But, unfortunatly I think that support of only methods without parameters - seems to be not full enough - if it needs to use reflection to invoke methods, nothing can't prevent us of invoking method with parameters that were bind to source properties.

Second moment is about path expression parsing. Now the string parsing occurs in a simplified form, and I fear for its correctness, so I want to replace regex and other tools with using real parser, which can detect all properties, methods, types etc. Without that we can obtain many errors while addings new functional for this.

I hope you don't take displeasure. I can to notify you about library news.

P.S. good article, I was very pleased :)

@Alex141
Copy link
Owner

Alex141 commented Nov 15, 2017

I think it's better to do it with a new extension, for example CommandBinding, because the command may require additional specific properties: command availability expression, type of command: Delegate or Relay.

@Alex141 Alex141 added this to the 2.3.1.0 milestone Nov 15, 2017
@halllo
Copy link
Contributor Author

halllo commented Nov 15, 2017

I created an entire library for that kind of command binding. Have a look at CommandContext.

@Alex141 Alex141 removed this from the 2.3.0.1 milestone Feb 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants