[UWP]如何实现自定义ContentTransition [英] [UWP] How to implement a custom ContentTransition

查看:122
本文介绍了[UWP]如何实现自定义ContentTransition的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在更改ContentControl的内容时使用此转换。

I would like to use this transition for when I change the Content of a ContentControl.

https://camo.githubusercontent .COM / 6e33d25c8db71744dbdd944b120edd7ba082ebd3 / 687474703a2f2f37786a6a63702e636f6d312e7a302e676c622e636c6f7564646e2e636f6d2f6769746875625f55494e617669676174696f6e416e696d6174696f6e44656661756c742e676966

https://camo.githubusercontent.com/6e33d25c8db71744dbdd944b120edd7ba082ebd3/687474703a2f2f37786a6a63702e636f6d312e7a302e676c622e636c6f7564646e2e636f6d2f6769746875625f55494e617669676174696f6e416e696d6174696f6e44656661756c742e676966

请注意你回答之前,这是不可能的,因为你需要同时访问以前的UI元素和新的UI元素中使用故事板。

Please note before you answer that this is NOT POSSIBLE USING Storyboards because you need access to both the previous UI Element and the new UI Element.

有什么想法吗?

推荐答案

Hello Anargyros Tomaras,

Hello Anargyros Tomaras,

感谢您对UWP的关注。对于自定义内容转换,我找不到任何关于它的文档。我们唯一支持的方式是使用动画。我已经检查了你的视频,我可以看到它看起来像一个页面导航,我就是这样吗?我认为我们可能需要使用它:
ConnectedAnimationService类

ConnectedAnimation类

Thanks for your interest in UWP. For custom contenttransition I cannot find any document about it. The only supported way for us is to use animation. I've checked your video and I can see it looks like a page navigation, I'm I right on this? I think we may need to use this: ConnectedAnimationService class and ConnectedAnimation class

请参阅以下内容:

"Windows 10,版本1607引入了新的
ConnectedAnimationService
用于实现动画的API,其中元素在导航期间在视图之间显示动画。此API与其他动画库
API具有不同的使用模式。 中介绍了 ConnectedAnimationService 的用法
参考页
。"

"Windows 10, version 1607 introduces a new ConnectedAnimationService API for implementing animations where an element appears to animate between views during a navigation. This API has a different usage pattern from the other animation library API's. Usage of ConnectedAnimationService is covered in the reference page."

该网页上的GitHub示例链接错误但你可以参考这里:

And the GitHub sample link is wrong on that page but you can refer to here:

https://github.com/Microsoft/WindowsUIDevLabs/tree/master/SampleGallery/Samples/SDK%2014393/ConnectedAnimationSample

视频在此处:

https://channel9.msdn.com/Events/Build/2016/P485

实际上我不知道我们是否可以将其称为自定义转换,我不确定这是否是您想要的。但是为了避免这个想法,如果你想要保持某种动画的前后动作,你可以试试这个。请注意,这是从
14393 SDK开始,因此您需要更改目标。

Actually I don't know if we can call this a custom Transition and I'm not so sure whether this is what you want. But at lest with this idea if you want to keep some kind of animation back and forward you can try this. Please notice that this is start from 14393 SDK so you need to change the target.

祝你好运,

Barry

 


这篇关于[UWP]如何实现自定义ContentTransition的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆