向datatemplate / itemstemplate添加行为 [英] Add behavior to datatemplate/itemstemplate

查看:99
本文介绍了向datatemplate / itemstemplate添加行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,

 

是否可以添加行为(在我的情况下  TranslateZoomRotateBehavior)到itemtemplate / datatemplate。我有一个surfacelistbox
,其中的项目由数据绑定填充。但是我希望当我对某个项目进行旋转手势时,它会旋转(如果可能的话,所有项目都会旋转),每次180度;

is it possible to add a behavior (in my case TranslateZoomRotateBehavior) to an itemtemplate/datatemplate. I have a surfacelistbox where the items get filled by databinding. But i want when i do a rotate gesture on an item, it rotates (and if possible all items rotate), each time 180°.

谢谢!

推荐答案

我刚刚尝试过它,它似乎可以通过将其放入模板中而正常工作。我使用了ItemContainerStyle,但它也可以在ItemTEmplate中使用。如果它不起作用,请发布您正在使用的xaml。
I just tried it, it seems to work ok by putting it into the template. I used the ItemContainerStyle, but it should work in the ItemTEmplate as well. If it doesn't work, post the xaml you are using.


这篇关于向datatemplate / itemstemplate添加行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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