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.

RootView.xaml 5.9 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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="100"
  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 Device}" />
  71. <TextBlock
  72. HorizontalAlignment="Center"
  73. VerticalAlignment="Center"
  74. FontSize="18"
  75. FontWeight="Bold"
  76. Foreground="Red"
  77. Text="{Binding IsActive, Converter={StaticResource TOC}}" />
  78. </StackPanel>
  79. </Button.Content>
  80. </Button>
  81. </DataTemplate>
  82. </ListBox.ItemTemplate>
  83. </ListBox>
  84. <DataGrid
  85. AutoGenerateColumns="False"
  86. Background="Transparent"
  87. IsReadOnly="True"
  88. ItemsSource="{Binding Result}"
  89. Style="{StaticResource DataGridBaseStyle}">
  90. <DataGrid.RowStyle>
  91. <Style BasedOn="{StaticResource DataGridRowStyle}" TargetType="DataGridRow">
  92. <Setter Property="Background" Value="Transparent" />
  93. <Style.Triggers>
  94. <Trigger Property="UIElement.IsMouseOver" Value="true">
  95. <Setter Property="Background" Value="Transparent" />
  96. </Trigger>
  97. </Style.Triggers>
  98. </Style>
  99. </DataGrid.RowStyle>
  100. <DataGrid.Columns>
  101. <DataGridTextColumn
  102. Width="260"
  103. Binding="{Binding CardNo}"
  104. ElementStyle="{StaticResource CenterAlignmentStyle}"
  105. Header="卡号"
  106. HeaderStyle="{StaticResource SaleLogHeader}" />
  107. <DataGridTextColumn
  108. Width="260"
  109. Binding="{Binding Money}"
  110. ElementStyle="{StaticResource CenterAlignmentStyle}"
  111. Header="金额"
  112. HeaderStyle="{StaticResource SaleLogHeader}" />
  113. <DataGridTextColumn
  114. Width="260"
  115. Binding="{Binding Location}"
  116. ElementStyle="{StaticResource CenterAlignmentStyle}"
  117. Header="档口"
  118. HeaderStyle="{StaticResource SaleLogHeader}" />
  119. <DataGridTextColumn
  120. Width="260"
  121. Binding="{Binding CreateTime, StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}"
  122. ElementStyle="{StaticResource CenterAlignmentStyle}"
  123. Header="消费时间"
  124. HeaderStyle="{StaticResource SaleLogHeader}" />
  125. </DataGrid.Columns>
  126. </DataGrid>
  127. </StackPanel>
  128. </hc:Window>