NControl
NControl copied to clipboard
Add the generic variant for NControlViewRenderer
This will ease re-use for controls that inherit from NControlView, by providing direct access to the rendered class, in case it's different than NControlView, without having to cast it manually.
Thanks for the PR, the problem with this one is that it contains no changes to the Windows code, would you be able to take a look at this and see if you can update?
Sure, not sure how I missed that :(
@chrfalch Done
Hi Timotei,
Could you please provide a short explanation with code samples telling me about why you want this (provide a few use cases)? That makes integrating the pull request much more easy :-)
Chris
On Sat, Feb 20, 2016 at 6:19 PM, Timotei Dolean [email protected] wrote:
@chrfalch https://github.com/chrfalch Done
— Reply to this email directly or view it on GitHub https://github.com/chrfalch/NControl/pull/48#issuecomment-186655981.
I can do a sample if you want, not sure it will help much given the nature of the change.
Basically, the reason for this is to simplify the code when implementing renderers for NControlView-based controls. When you have custom controls that inherit from NControlView, and you want to do the renderers, you need to cast the element to the actual wanted element. With the generic variant no cast is needed as we're 100% sure which type it is :)
This sounds like a reasonable plan. Will take a look an evaluate the PR during the week. Thanks!
Chris
On Sun, Feb 21, 2016 at 11:33 PM, Timotei Dolean [email protected] wrote:
I can do a sample if you want, not sure it will help much given the nature of the change.
Basically, the reason for this is to simplify the code when implementing renderers for NControlView-based controls. When you have custom controls that inherit from NControlView, and you want to do the renderers, you need to cast the element to the actual wanted element. With the generic variant no cast is needed as we're 100% sure which type it is :)
— Reply to this email directly or view it on GitHub https://github.com/chrfalch/NControl/pull/48#issuecomment-186934820.
(No need for a sample, I understand your use case).
On Mon, Feb 22, 2016 at 10:39 AM, Christian Falch <[email protected]
wrote:
This sounds like a reasonable plan. Will take a look an evaluate the PR during the week. Thanks!
Chris
On Sun, Feb 21, 2016 at 11:33 PM, Timotei Dolean <[email protected]
wrote:
I can do a sample if you want, not sure it will help much given the nature of the change.
Basically, the reason for this is to simplify the code when implementing renderers for NControlView-based controls. When you have custom controls that inherit from NControlView, and you want to do the renderers, you need to cast the element to the actual wanted element. With the generic variant no cast is needed as we're 100% sure which type it is :)
— Reply to this email directly or view it on GitHub https://github.com/chrfalch/NControl/pull/48#issuecomment-186934820.
Hi, sorry for the delay with this PR; Wouldn't this change the behavior for existing renderers and controls, i.e. it is not backwards compatible?
Hi.
Nope, it's backwards compatible.