Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

135 рядки
6.3 KiB

  1. <hc:Window
  2. x:Class="HKCardOUT.Views.RootView"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:c="clr-namespace:CalcBinding;assembly=CalcBinding"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:hc="https://handyorg.github.io/handycontrol"
  8. xmlns:helper="clr-namespace:HKCardOUT.Helper"
  9. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  10. xmlns:s="https://github.com/canton7/Stylet"
  11. xmlns:viewModels="clr-namespace:HKCardOUT.ViewModels"
  12. x:Name="Main"
  13. Title="海科智慧一卡通平台"
  14. d:DataContext="{d:DesignInstance Type=viewModels:RootViewModel}"
  15. ShowMaxButton="False"
  16. ShowMinButton="False"
  17. ShowTitle="True"
  18. WindowStartupLocation="CenterScreen"
  19. WindowState="Maximized"
  20. mc:Ignorable="d">
  21. <hc:Window.Resources>
  22. <helper:HKConverter x:Key="TOC" />
  23. <Style x:Key="SaleLogHeader" TargetType="DataGridColumnHeader">
  24. <Setter Property="FontSize" Value="18" />
  25. <Setter Property="Background" Value="Transparent" />
  26. <Setter Property="Foreground" Value="White" />
  27. <Setter Property="HorizontalAlignment" Value="Center" />
  28. <Setter Property="VerticalAlignment" Value="Center" />
  29. </Style>
  30. <Style x:Key="CenterAlignmentStyle" TargetType="TextBlock">
  31. <Setter Property="TextAlignment" Value="Center" />
  32. <Setter Property="VerticalAlignment" Value="Center" />
  33. <Setter Property="Foreground" Value="White" />
  34. <Setter Property="FontSize" Value="22" />
  35. <Setter Property="FontWeight" Value="Bold" />
  36. <Setter Property="Background" Value="Transparent" />
  37. </Style>
  38. </hc:Window.Resources>
  39. <hc:Window.Background>
  40. <ImageBrush ImageSource="/HKResouces/背景.jpg" />
  41. </hc:Window.Background>
  42. <StackPanel>
  43. <ListBox
  44. Background="Transparent"
  45. BorderThickness="0"
  46. ItemsSource="{Binding Ad}"
  47. Style="{StaticResource WrapPanelHorizontalListBox}">
  48. <ListBox.ItemsPanel>
  49. <ItemsPanelTemplate>
  50. <WrapPanel HorizontalAlignment="Left" VerticalAlignment="Center" />
  51. </ItemsPanelTemplate>
  52. </ListBox.ItemsPanel>
  53. <ListBox.ItemTemplate>
  54. <DataTemplate>
  55. <Button
  56. Width="160"
  57. Height="80"
  58. Margin="20,0,0,0"
  59. s:View.ActionTarget="{Binding DataContext, ElementName=Main}"
  60. Command="{s:Action UpdateAction}"
  61. CommandParameter="{Binding .}"
  62. Style="{StaticResource ButtonDefault}">
  63. <Button.Content>
  64. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
  65. <TextBlock
  66. HorizontalAlignment="Center"
  67. VerticalAlignment="Center"
  68. FontSize="18"
  69. FontWeight="Bold"
  70. Text="{Binding Stalls, StringFormat=档口:{0}}" />
  71. <TextBlock
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. FontSize="18"
  75. FontWeight="Bold"
  76. Text="{Binding Device, StringFormat=设备:{0}}" />
  77. <TextBlock
  78. HorizontalAlignment="Center"
  79. VerticalAlignment="Center"
  80. FontSize="18"
  81. FontWeight="Bold"
  82. Foreground="Red"
  83. Text="{Binding IsActive, Converter={StaticResource TOC}}" />
  84. </StackPanel>
  85. </Button.Content>
  86. </Button>
  87. </DataTemplate>
  88. </ListBox.ItemTemplate>
  89. </ListBox>
  90. <DataGrid
  91. AutoGenerateColumns="False"
  92. Background="Transparent"
  93. IsReadOnly="True"
  94. ItemsSource="{Binding Result}"
  95. Style="{StaticResource DataGridBaseStyle}">
  96. <DataGrid.RowStyle>
  97. <Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
  98. <Setter Property="Background" Value="Transparent" />
  99. <Style.Triggers>
  100. <Trigger Property="UIElement.IsMouseOver" Value="true">
  101. <Setter Property="Background" Value="Transparent" />
  102. </Trigger>
  103. </Style.Triggers>
  104. </Style>
  105. </DataGrid.RowStyle>
  106. <DataGrid.Columns>
  107. <DataGridTextColumn
  108. Width="300"
  109. Binding="{Binding CardNo}"
  110. ElementStyle="{StaticResource CenterAlignmentStyle}"
  111. Header="卡号"
  112. HeaderStyle="{StaticResource SaleLogHeader}" />
  113. <DataGridTextColumn
  114. Width="260"
  115. Binding="{Binding Money}"
  116. ElementStyle="{StaticResource CenterAlignmentStyle}"
  117. Header="金额"
  118. HeaderStyle="{StaticResource SaleLogHeader}" />
  119. <DataGridTextColumn
  120. Width="260"
  121. Binding="{Binding Location}"
  122. ElementStyle="{StaticResource CenterAlignmentStyle}"
  123. Header="档口"
  124. HeaderStyle="{StaticResource SaleLogHeader}" />
  125. <DataGridTextColumn
  126. Width="260"
  127. Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
  128. ElementStyle="{StaticResource CenterAlignmentStyle}"
  129. Header="消费时间"
  130. HeaderStyle="{StaticResource SaleLogHeader}" />
  131. </DataGrid.Columns>
  132. </DataGrid>
  133. </StackPanel>
  134. </hc:Window>