-
-
Notifications
You must be signed in to change notification settings - Fork 144
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
Conditional methods with parameters as actions? #147
Comments
Looks like they added guard methods since I last used it. The tricky bit here is knowing when the re-evaluate the guard method. With guard properties we use INPC, but that doesn't work for methods. It looks like Caliburn.Micro used If you can come up with a nice way of implementing something similar to this, I'm all ears. This might also be useful |
Actually, if the button (or whatever) evaluates |
Ah no, doesn't look like that works, sadly. |
I would do that if I had the knowledge but I am just a beginner and I am afraid that would be too much for me to do at this moment. I am a student and am just learning the principles of mvvm, wpf, etc. But thank you very much for taking the time and answer. |
I agree, thanks Canton7 for taking the time to look into this suggestion. I'm not new to MVVM, but always struggled with what I was using (mostly DevExpress MVVM) - I've been successfully using Stylet_ now for a couple of projects, AND I have to say, Stylet has finally made using MVVM with my WPF apps so much easier. I look forward to ANY additions to this project! |
Heh, maybe Action can subscribe to changes on the button's |
Hi @canton7,
Thanks for this awesome library, I have been using it and I just love how simple and powerful it is.
On caliburn you can use methods with parameters for conditions(for reference: https://caliburnmicro.com/documentation/actions#action-parameters), say
From what I read on the documentation with Stylet that is not possible with a method or taking a parameter.
I could probably do a hacky approach which would involve binding 2 properties to achieve something close to the above but its no ideal.
Do you have any plans on adding that into Stylet or have I missed something and that is indeed possible?
The text was updated successfully, but these errors were encountered: