listboxitem

Complex UI inside ListBoxItem

五迷三道 提交于 2019-11-26 02:01:10
问题 In WPF, I can add whatever UI into ListBoxItem s by providing the ListBox with an ItemTemplate : <ListBox ItemsSource=\"{Binding}\"> <ListBox.ItemTemplate> <DataTemplate> <Border BorderThickness=\"1\" BorderBrush=\"Gray\" CornerRadius=\"8\" Padding=\"4,0,4,0\"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width=\"50\"/> <ColumnDefinition/> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition/> <RowDefinition/> <RowDefinition/> </Grid.RowDefinitions> <CheckBox Grid.Column=\"1\"