终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Test.xaml 5.8 KiB

1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <UserControl
  2. x:Class="BPASmartClient.MorkCL.View.Test"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:BPASmartClient.MorkCL.View"
  7. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  8. xmlns:vm="clr-namespace:BPASmartClient.MorkCL.ViewModel"
  9. Name="测试"
  10. d:DesignHeight="450"
  11. d:DesignWidth="800"
  12. mc:Ignorable="d">
  13. <UserControl.DataContext>
  14. <vm:testViewModel />
  15. </UserControl.DataContext>
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="/BPASmartClient.MorkCL;component/CustomStyle/CustomStyle.xaml" />
  20. </ResourceDictionary.MergedDictionaries>
  21. <Style TargetType="DataGridCell">
  22. <Setter Property="FontSize" Value="16" />
  23. <Setter Property="VerticalAlignment" Value="Center" />
  24. <Setter Property="Background" Value="Transparent" />
  25. <Setter Property="Foreground" Value="{StaticResource FontColor}" />
  26. <Setter Property="BorderBrush" Value="{StaticResource bordColor}" />
  27. </Style>
  28. <Style TargetType="DataGridColumnHeader">
  29. <Setter Property="FontSize" Value="22" />
  30. <Setter Property="FontWeight" Value="Bold" />
  31. <Setter Property="VerticalAlignment" Value="Center" />
  32. <Setter Property="Background" Value="Transparent" />
  33. <Setter Property="Foreground" Value="{StaticResource FontColor}" />
  34. <Setter Property="BorderBrush" Value="{StaticResource TitleBorderColor}" />
  35. <Setter Property="BorderThickness" Value="1" />
  36. </Style>
  37. </ResourceDictionary>
  38. </UserControl.Resources>
  39. <StackPanel Orientation="Vertical">
  40. <Button
  41. Width="100"
  42. Height="30"
  43. Command="{Binding testCommand}"
  44. Content="Init" />
  45. <ListView Height="100" ItemsSource="{Binding TBS}">
  46. <ListView.View>
  47. <GridView>
  48. <GridView.Columns>
  49. <GridViewColumn Width="200">
  50. <GridViewColumn.CellTemplate>
  51. <DataTemplate>
  52. <TextBlock Text="{Binding Id}" />
  53. </DataTemplate>
  54. </GridViewColumn.CellTemplate>
  55. <GridViewColumnHeader
  56. HorizontalContentAlignment="Center"
  57. Content="ID"
  58. IsHitTestVisible="False" />
  59. </GridViewColumn>
  60. <GridViewColumn Width="200">
  61. <GridViewColumn.CellTemplate>
  62. <DataTemplate>
  63. <TextBlock Text="{Binding Name}" />
  64. </DataTemplate>
  65. </GridViewColumn.CellTemplate>
  66. <GridViewColumnHeader
  67. HorizontalContentAlignment="Center"
  68. Content="Name"
  69. IsHitTestVisible="False" />
  70. </GridViewColumn>
  71. <GridViewColumn Width="Auto">
  72. <GridViewColumn.CellTemplate>
  73. <DataTemplate>
  74. <TextBlock Text="{Binding Description}" />
  75. </DataTemplate>
  76. </GridViewColumn.CellTemplate>
  77. <GridViewColumnHeader
  78. HorizontalContentAlignment="Center"
  79. Content="描述"
  80. IsHitTestVisible="False" />
  81. </GridViewColumn>
  82. <GridViewColumn Width="200">
  83. <GridViewColumn.CellTemplate>
  84. <DataTemplate>
  85. <TextBlock Text="{Binding Loc}" />
  86. </DataTemplate>
  87. </GridViewColumn.CellTemplate>
  88. <GridViewColumnHeader
  89. HorizontalContentAlignment="Center"
  90. Content="位置"
  91. IsHitTestVisible="False" />
  92. </GridViewColumn>
  93. </GridView.Columns>
  94. </GridView>
  95. </ListView.View>
  96. </ListView>
  97. <DataGrid
  98. Height="500"
  99. AutoGenerateColumns="False"
  100. CanUserAddRows="False"
  101. CanUserDeleteRows="False"
  102. CanUserReorderColumns="False"
  103. CanUserResizeRows="False"
  104. CanUserSortColumns="False"
  105. IsHitTestVisible="False"
  106. IsReadOnly="True"
  107. ItemsSource="{Binding TBS}"
  108. RowHeaderWidth="0">
  109. <DataGrid.Columns>
  110. <DataGridTextColumn
  111. Width="350"
  112. Binding="{Binding Id}"
  113. Header="ID" />
  114. <DataGridTextColumn
  115. Width="70"
  116. Binding="{Binding Name}"
  117. Header="名称" />
  118. <DataGridTextColumn
  119. Width="*"
  120. Binding="{Binding Description}"
  121. Header="描述" />
  122. <DataGridTextColumn
  123. Width="100"
  124. Binding="{Binding Loc}"
  125. Header="位置" />
  126. </DataGrid.Columns>
  127. </DataGrid>
  128. </StackPanel>
  129. </UserControl>