Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
855 views
in Technique[技术] by (71.8m points)

uwp xaml - How do offsets work while animating images in UWP Apps?

I am trying to animate an image in the code behind such that it moves from left to right and then fades. I have code which looks like this.

MyDemoControl.xaml.cs

this.image.offset(offsetX:0, offsetY:0, duration:0) .fade(1, duration:1)

My understanding is that OffsetX:0 and OffsetY:0 would be bottom left of the page. But I don't see this happening. I see different images positions differently. Any help in understanding offsets would be highly appreciated ?

question from:https://stackoverflow.com/questions/65927179/how-do-offsets-work-while-animating-images-in-uwp-apps

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

But I don't see this happening. I see different images positions differently. Any help in understanding offsets would be highly appreciated ?

It looks you have used Microsoft.Toolkit.Uwp.UI.Animations.Behaviors to animate your image, OffsetX OffsetY that use to move the image to other position. The reference is the image control self rather than image parent.

So if you just set OffsetX OffsetY as 0, the image control will not animate.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...