终端一体化运控平台
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 

30 wiersze
1.7 KiB

  1. <UserControl x:Class="WPFDemo.TheListBox"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:WPFDemo"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450" d:DesignWidth="800">
  9. <ListView x:Name="listView"
  10. ItemsSource="{Binding ViewItems,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  11. Background="{x:Null}" Foreground="White"
  12. PreviewMouseMove="ListView_PreviewMouseMove"
  13. PreviewMouseLeftButtonUp="lisbox_PreviewMouseLeftButtonUp">
  14. <ListBox.ItemTemplate>
  15. <ItemContainerTemplate>
  16. <Border x:Name="border" Tag="border" BorderBrush="Aquamarine" MouseLeftButtonDown="Border_MouseLeftButtonDown" BorderThickness="1" Padding="5" Background="#FF18888A">
  17. <Grid>
  18. <Grid.ColumnDefinitions>
  19. <ColumnDefinition Width="60"/>
  20. <ColumnDefinition/>
  21. </Grid.ColumnDefinitions>
  22. <TextBlock Margin="10,0,10,0" Grid.Column="0" Text="{Binding Name,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
  23. <TextBlock Grid.Column="1" Text="{Binding Ph,Mode=OneWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
  24. </Grid>
  25. </Border>
  26. </ItemContainerTemplate>
  27. </ListBox.ItemTemplate>
  28. </ListView>
  29. </UserControl>