开发者

Silverlight - ListBox Styling and Behavior

开发者 https://www.devze.com 2022-12-21 23:57 出处:网络
I am trying to do two things with a ListBox in Silverlight. However, I cannot seem to figure them out.

I am trying to do two things with a ListBox in Silverlight. However, I cannot seem to figure them out.

  1. I need to change the color of a selected item to yellow, instead of the default blue.
  2. I set the selected items pr开发者_如何学Googrammatically. Each item is a CheckBox. How do I allow the user to check or uncheck the CheckBox, but keep the item in the ListBox selected?

Thank you!


1) To change the visual structure and visual behavior of a ListBoxItem, copy and modify its default style and template. Use Expression Blend to export the default style. This topic is discussed here(https://stackoverflow.com/questions/1368070/silverlight-listbox-item-style).

2) When I put a CheckBox control on the DataTemplate of a ListBox.ItemTemplate, I am able to check and uncheck the control by clicking the checkbox itself or its associated text without effecting the selection of the ListBoxItem. I am not sure if this is what you are asking. The demensions of your DataTemplate may make this easier or more difficult for the user.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号