问题
simple question for you fellas. I have an image inside a Canvas, with a Canvas.Left property i want to change programaticly. How do i do that?
回答1:
Call Canvas.SetLeft(theImage, newValue);
This is the standard means of using Attached Properties from Code. When implementing an attached property (such as Canvas.Left), it's standard to include a static method that is named SetPropertyName for a given attached property named PropertyName.
来源:https://stackoverflow.com/questions/9282796/how-to-change-image-inside-canvass-canvas-left-property-in-wpf