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.

141 lines
6.5 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. <Grid>
  43. <Grid.ColumnDefinitions>
  44. <ColumnDefinition />
  45. <ColumnDefinition Width="200" />
  46. </Grid.ColumnDefinitions>
  47. <DataGrid
  48. AutoGenerateColumns="False"
  49. Background="Transparent"
  50. IsReadOnly="True"
  51. ItemsSource="{Binding Result}"
  52. Style="{StaticResource DataGridBaseStyle}">
  53. <DataGrid.RowStyle>
  54. <Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
  55. <Setter Property="Background" Value="Transparent" />
  56. <Style.Triggers>
  57. <Trigger Property="UIElement.IsMouseOver" Value="true">
  58. <Setter Property="Background" Value="Transparent" />
  59. </Trigger>
  60. </Style.Triggers>
  61. </Style>
  62. </DataGrid.RowStyle>
  63. <DataGrid.Columns>
  64. <DataGridTextColumn
  65. Width="300"
  66. Binding="{Binding CardNo}"
  67. ElementStyle="{StaticResource CenterAlignmentStyle}"
  68. Header="卡号"
  69. HeaderStyle="{StaticResource SaleLogHeader}" />
  70. <DataGridTextColumn
  71. Width="200"
  72. Binding="{Binding Money}"
  73. ElementStyle="{StaticResource CenterAlignmentStyle}"
  74. Header="金额"
  75. HeaderStyle="{StaticResource SaleLogHeader}" />
  76. <DataGridTextColumn
  77. Width="200"
  78. Binding="{Binding Location}"
  79. ElementStyle="{StaticResource CenterAlignmentStyle}"
  80. Header="档口"
  81. HeaderStyle="{StaticResource SaleLogHeader}" />
  82. <DataGridTextColumn
  83. Width="300"
  84. Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
  85. ElementStyle="{StaticResource CenterAlignmentStyle}"
  86. Header="消费时间"
  87. HeaderStyle="{StaticResource SaleLogHeader}" />
  88. </DataGrid.Columns>
  89. </DataGrid>
  90. <ListBox
  91. Grid.Column="1"
  92. Background="Transparent"
  93. BorderThickness="0"
  94. ItemsSource="{Binding Ad}"
  95. Style="{StaticResource WrapPanelVerticalListBox}">
  96. <ListBox.ItemsPanel>
  97. <ItemsPanelTemplate>
  98. <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Top" />
  99. </ItemsPanelTemplate>
  100. </ListBox.ItemsPanel>
  101. <ListBox.ItemTemplate>
  102. <DataTemplate>
  103. <Button
  104. Width="160"
  105. Height="80"
  106. Margin="20,20,0,0"
  107. s:View.ActionTarget="{Binding DataContext, ElementName=Main}"
  108. Command="{s:Action UpdateAction}"
  109. CommandParameter="{Binding .}"
  110. Style="{StaticResource ButtonDefault}">
  111. <Button.Content>
  112. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
  113. <TextBlock
  114. HorizontalAlignment="Center"
  115. VerticalAlignment="Center"
  116. FontSize="18"
  117. FontWeight="Bold"
  118. Text="{Binding Stalls, StringFormat=档口:{0}}" />
  119. <TextBlock
  120. HorizontalAlignment="Center"
  121. VerticalAlignment="Center"
  122. FontSize="18"
  123. FontWeight="Bold"
  124. Text="{Binding Device, StringFormat=设备:{0}}" />
  125. <TextBlock
  126. HorizontalAlignment="Center"
  127. VerticalAlignment="Center"
  128. FontSize="18"
  129. FontWeight="Bold"
  130. Foreground="Red"
  131. Text="{Binding IsActive, Converter={StaticResource TOC}, StringFormat=广告:{0}}" />
  132. </StackPanel>
  133. </Button.Content>
  134. </Button>
  135. </DataTemplate>
  136. </ListBox.ItemTemplate>
  137. </ListBox>
  138. </Grid>
  139. </hc:Window>