|
- <UserControl
- x:Class="WPFDemo.TheListBox"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:WPFDemo"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- d:DesignHeight="450"
- d:DesignWidth="800"
- mc:Ignorable="d">
- <ListView
- x:Name="listView"
- Background="{x:Null}"
- Foreground="White"
- ItemsSource="{Binding ViewItems, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- PreviewMouseLeftButtonUp="lisbox_PreviewMouseLeftButtonUp"
- PreviewMouseMove="ListView_PreviewMouseMove">
- <ListBox.ItemTemplate>
- <ItemContainerTemplate>
- <Border
- x:Name="border"
- Padding="5"
- Background="#FF18888A"
- BorderBrush="Aquamarine"
- BorderThickness="1"
- MouseLeftButtonDown="Border_MouseLeftButtonDown"
- Tag="border">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="60" />
- <ColumnDefinition />
- <ColumnDefinition Width="100" />
- <ColumnDefinition Width="60" />
- </Grid.ColumnDefinitions>
- <TextBlock
- Grid.Column="0"
- Margin="10,0,10,0"
- Text="{Binding Name, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
- <TextBlock Grid.Column="1" Text="{Binding Ph, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
- <TextBox Grid.Column="1" Width="100" />
- <ComboBox Grid.Column="2" Width="60">
- <ComboBoxItem>sdsds</ComboBoxItem>
- <ComboBoxItem>sdsds</ComboBoxItem>
- <ComboBoxItem>sdsds</ComboBoxItem>
- </ComboBox>
- </Grid>
- </Border>
- </ItemContainerTemplate>
- </ListBox.ItemTemplate>
- </ListView>
- </UserControl>
|