如何自定义列表框中选择的项目风格在Silverlight 4 [英] how to customize the listbox selected item style in silverlight 4

查看:209
本文介绍了如何自定义列表框中选择的项目风格在Silverlight 4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Silverlight列表框在其中一个列表项包含一个图像,它的名字和它的价格。列表项的布局将作如下安排:根据图像的图像名称将显示,价格将要显示的图像名下

I am having a silverlight listbox in which a list item contains an image, its name and its price. the layout of the list item will be as follows: Under the image the image name will be shown, under the image name the price will be shown.

现在的问题是,当我选择一个列表项的所有三个项目(图像,图像名称及其价格)被选中。这是默认的行为。

Now the problem is when i select an list item all the three items(image, image name and its price ) are selected. this is the default behavior.

现在的要求是,当我选择列表项只有图像应该被选中。

Now the requirement is when i select a list item only the image should be selected.

请让我知道如果有一种方法可以做到这一点。

please let me know if there is a way to do this..

推荐答案

您将需要定制视觉国家正在使用的列表框模板选择。检查出VSM是如何工作的一些教程。

You'll need to customize the Visual State "Selected" of the Listbox template you are using. Check out some tutorials on how VSM works.

  • http://timheuer.com/blog/archive/2008/06/04/silverlight-introduces-visual-state-manager-vsm.aspx
  • http://weblogs.asp.net/dwahlin/archive/2008/11/23/using-the-visual-state-manager-in-silverlight-templates.aspx
  • http://www.c-sharpcorner.com/UploadFile/mdobbles/SilverlightVsmNavbar08062008002808AM/SilverlightVsmNavbar.aspx

这篇关于如何自定义列表框中选择的项目风格在Silverlight 4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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