c# - error: 'object' no definition/extension method -
using code (shown below) have got error this:
'object' not contain definition 'rendertransform' , no extension method 'rendertransform' accepting first argument of type 'object' found (are missing using directive or assembly language
i have no thought why showing error according examples (of this) should work. code:
public void rotate(object sender, int rotationamount, int centerx, int centery) { rotatetransform rotate = new rotatetransform(rotationamount); rotatetransform.centerx = centerx; rotatetransform.centery = centery; sender.rendertransform = rotatetransform; }
you have cast sender
(which declared object
) appropriate type:
uielement element = sender uielement; if (element != null) element.rendertransform = rotatetransform;
c# wpf
No comments:
Post a Comment