silverlight 中的列表框样式和控件模板问题

发布于 2024-09-07 09:46:37 字数 517 浏览 0 评论 0原文

我必须以如下图所示的方式更改列表框的控件模板

alt text http:// /www.freeimagehosting.net/uploads/05598e4d35.png

我在列表框数据模板中添加了切换按钮... 列表框样式模板中有一个堆栈面板... 所以结构就像 border - stackpanel - grid - itemcontainer[boder-togglerbutton]

现在使第一个和最后一个项目弯曲...有什么方法... 如果我使 stackpanel 边框弯曲...当选择第一个项目并且其背景发生变化...它在外边框内显示一个正方形...所以我无法看到下面显示的内容...

有什么想法吗?如何以列表框的方式完成设计,可以如上图所示...

在图像 1,3 和 4 项目中选择,其他项目处于正常模式...-

提前致谢

I have to change Listbox's control templated in a way that it can look like below image

alt text http://www.freeimagehosting.net/uploads/05598e4d35.png

i have added togglebutton in listboxdatatemplate...
have one stackpanel in listbox style template...
so structure is like
border - stackpanel - grid - itemcontainer[boder-togglerbutton]

now to make first and last item curved... what are the ways...
if i make stackpanel border curved... when firstitem is selected and its background is changed... it shows a square inside outer border... so i am not able to get look showed below...

any idea?? how to get design done in the way with listbox tht can be showed like image above...

in image 1,3 and 4 items are selected and others are in normal mode...

-thanks in advance

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

﹏雨一样淡蓝的深情 2024-09-14 09:46:37

我通过在 ItemTemplate 内的 Blend 中创建一个位于同一空间的左边框和右边框来完成此操作。 leftBorder 用cornerRadius 10,0,0,10 定义,而right 用cornerRadius 0,10,10,0 定义。然后,我将它们都设置为不透明度 0(如果您愿意,可以使用可见性),并根据列表中的第一个和最后一个项目对这两个加载事件设置 ChangePropertyAction。

这是不好的部分,我确实需要根据列表中的项目来执行此操作,但您可以定义另一个属性并将其设置为第一个和最后一个,或者如果列表中没有更多项目,则创建您设置的多个模板控件(不在模板中)。

如果您认为这可能对您感兴趣,请告诉我,我将在我的博客上发布并尝试根据您的情况进行一些调整。我不知道如何将项目上传到这里。

I did it with a listbox in Blend inside of the ItemTemplate by creating a leftBorder and a right Border that are in the same space. The leftBorder is defined with cornerRadius 10,0,0,10 and the right with cornerRadius 0,10,10,0. I then set them both to opacity 0 (you can use visibility if you prefer) and set a ChangePropertyAction on both of thier loaded events conditional on the first and last item in your list.

That is the bad part, I did need to do it conditional on the items in your list but you could define another property and set that to first and last or create multiple templates that you set if there are no more items in the list from the control (not in the template).

If you think this may be interesting to you, let me know and I will post on my blog as well as try to make a couple of adjustments for your situation. I am not sure how to upload a project to here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文