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
Declarative binding dependencies #300
Comments
I'm allready doing this in my implementation.
|
If you've got any code to share/contribute, then I'm happy to consider Pulls :)
Not sure what you are asking for here - but sounds like something different - the main suggestion here is about binding views to ViewModels. Sounds like you might have some interesting ideas - if you do, please do open them as new feature requests with a bit more detail - thanks :) |
From what I understand, the DependsOn atribute would be used to fire the RaisePropertyChanged method, when the 'dependant' properties are changed. Am I corrrect? My implementation of the DependsOn, is done at the base of my ViewModels, that inherit from MvxViewModel. Basically, when an new viewmodel is constructed, I store info of all the properties and methods that depend on another property. I also add an handler for PropertyChanged in the ViewModel. Perhaps i'll open a new request. Because this implmentation also covers changes for collections and items inside the collections... |
That's not what I was thinking of doing.... My idea was that I would change the source binding so that it listened for more properties names here - https://github.com/slodge/MvvmCross/blob/v3/Cirrious/Cirrious.MvvmCross.Binding/Bindings/Source/MvxPropertyInfoSourceBinding.cs#L102
Sounds interesting - please do either open an issue or blog about your stuff - sounds interesting and sounds like something people can do themselves without touching the core Mvx code :) I like different ideas :) Thanks! (one other interesting idea is that at least one person has Fody working as an AOP technique!) |
ah ok. I'll definitely post my approach. It has some more funcionalities than the ones I've described above. Thanks |
I've thought about it and I like your approach more than mine... so I'll add an interception hook into MvxNotifyPropertyChanged where people can do anything they want and then I'll close this! Please do blog your ideas somewhere - good stuff :) |
Actually I'm preparing a simple project with that implementation to put it in GitHub. I'll try to finish it today. Lots of things to do at work... Just one question: I'm a newbie in this 'sharing ideas and code throughout the internet' and I'm not quite sure where could I post something about this. In stackoverflow is a question oriented site. In GitHub it feels that is more a 'request new features' site. Where could I post something like this? Thanks :) |
I'm not sure! Some options:
|
As well as sites like CodeProject, GeekChamp are very friendly and happily post articles. As long as Google can find it, it will be found :) |
I've posted a simple example with my DependsOn implementation, in GitHub. The Readme file is still very poor on info, but tomorrow (9 of June) I will complete the file with detailed info of what I'm doing there, how can be used and my vision for future improvements in that approach. Hope this can be usefull for someone. It has been for me :) |
Thanks @zleao Will take a look :) I haven't had time to put together a sample yet, but following your suggestion I added a new interceptor point which will get notifications from all To create an interceptor:
I think interceptors would normally need to work using I will put together a sample at some point... but right now a bit busy! |
@zleao - your sample looks good - I like it :) :) :) I'm a bit worried about the One thing you could maybe help is if you use One other 'interesting' thought for you: I learned recently that if an object sends a |
Yep, the weakreference is the way to go. Very similar to the implementation in the messenger plugin. That is actually one of the things I'm going to write in the readme file. |
I didn't know about that Notification particularity! But just to see if I got it, when you say "everything has changed", you're referring to say, an entire viewmodel? Or just a specific property? |
See #280 and the Remarks in http://msdn.microsoft.com/en-us/library/system.componentmodel.propertychangedeventargs.propertyname.aspx (Good night for now!) |
Between @zleao's excellent repo and the new rio code and the blog posts on Fody, this is definitely fully covered - closing |
Fix Memory Issues
We could extend
INotifyPropertyChanged
properties with an attribute like:The binding layer could use this to force
FullName
updates wheneverFirstName
ofLastName
changeThe text was updated successfully, but these errors were encountered: