how to customize the listbox selected item style in silverlight 4

。_饼干妹妹 提交于 2019-12-31 05:36:50

问题


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..


回答1:


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


来源:https://stackoverflow.com/questions/2832772/how-to-customize-the-listbox-selected-item-style-in-silverlight-4

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!