Fluent Syntax - generic methods
Hi, I have a structure as follows:
and I want to be able to do :
So the rule is that the method .PlacedIn(canvas) must be either last to be called or must be followed by .At().
And .PlacedIn(stackPanel) can be anywhere and followed by any method.
The second problem I solved quite easily by:
But I'm not sure about the .PlacedIn(canvas). I think it should return some other type than the generic
How can I do this?
and I want to be able to do :
So the rule is that the method .PlacedIn(canvas) must be either last to be called or must be followed by .At().
And .PlacedIn(stackPanel) can be anywhere and followed by any method.
The second problem I solved quite easily by:
But I'm not sure about the .PlacedIn(canvas). I think it should return some other type than the generic
T where : Control but then the information about the type is lost and I don't know how to return the proper type (Label, Image, ...) In the .At() method afterwards. How can I do this?