摘要: 如果将listbox的ItemTemplate绑定到DataTemplate,会发现listbox无法stretch。解决办法是将listbox的ItemContainerStyle绑定到一个style。如下所示:<Style x:Key="ListBoxItemStyle" TargetType="ListBoxItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch"/> <Setter Property 阅读全文
posted @ 2012-02-13 15:27 左手边的爱 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 当用foreach遍历ObservableCollection,如果使用Add或Remove操作,会出现以下错误:Collection was modified; enumeration operation may not execute解决办法是改为使用for循环。 阅读全文
posted @ 2012-02-13 13:32 左手边的爱 阅读(287) 评论(0) 推荐(0) 编辑