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
Make generic IViewFor<TViewModel> implementation optional in favor of non-generic IViewFor #3642
Comments
One more thing. Same deal with |
We aren't likely to change the signatures in this scenario. The advice is to generate a base class that's non-generic that implements We don't want a "object" based IView, it complicates a bunch of code for every other platform. It would force us to rely on more reflection then we already do. We been trying to minimise the amount of reflection used. |
Yeah this is a) blowing up the codebase with unnecessary meaningless code considerably, b) doesn't always work because as I said WinForms hate generics. I in fact don't see why can't just changing signature of command binder methods to accept |
Some options I can think of you can do as a alternative to Write your own resolver. You could probably scan for classes with a property named If performance matters you can use a .NET source generator to do the scanning and put it into a nice dictionary inside a class. Probably will be faster lookup then the current RxUI implementation. That way you can avoid the generic IViewFor I don't think going down the route of having 'object' everywhere is a solution for the rxui code base though. I'm tempted to do a optional component that does this one weekend from now. Won't be part of the main rxui though. I'll create a separate issue to track the idea. |
Maybe I am using MVVM/RxUI wrong, but I personally don't use view resolution whatsoever. That's why I said "except the last one", I mean the command binder stuff only. View resolution should probably stay as is with requiring the generic counterpart. |
The view resolution is the primary reason why IViewFor exists. It relies on the generic. |
Anyway. There's no plan to introduce a non generic IViewFor. |
I don't understand, I am just asking for a few methods which don't really require the It seems like we're talking about different things. |
As mentioned we aren't doing any changes to the IViewFor. |
I am not asking to... |
Re-reading your replies, sorry but I don't feel you ever understood what my request really is and just shot it down :\ |
You want to use the non generic IViewFor for the command binders or a version of the command binders that doesn't use the IViewFor at all is my understanding. You're asking for a fundamental change to the project where it's pretty stable. |
Hopefully the linked issue will solve your problem. |
Yes, that is what I wanted.
Yes. Thanks much and sorry for getting worked up! |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Is your feature request related to a problem? Please describe.
Windows Forms designer hates generics. Generics can't be designed properly, have to do nasty hacks to work around that. What it hates even more is inheriting generics. Most of the time you can't design the form that inherits from a generic, only once in a blue moon it can be opened (IIRC only before the first compilation, then designer breaks). The workaround for that is doing a proxy class in the inheritance chain but it's far from elegant and visual inheritance breaks as well. And it also can stop working without apparent reason.
Microsoft doesn't care about fixing that whatsoever, those bugs exist for like 20 years, and as such introducing generics in WinForms is effectively fighting WinForms. So the only proper way of doing it here is ditching generics in context of WinForms.
Describe the solution you'd like
IViewFor<TViewModel>
not being a required interface to implement where not needed.Describe alternatives you've considered
Just using generics. Led to countless hours of fighting WinForms designer.
Describe suggestions on how to achieve the feature
From a brief look in the ReactiveUI code those are the only usages (correct me if I am wrong):
I am not sure, but it seems that all of them except the last one are too specific because it gets upcasted to non-generic
IViewFor
later the call stack. I suggest to change signatures toIViewFor
.The text was updated successfully, but these errors were encountered: