LogPage.xaml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <UserControl
  2. x:Class="LogoForceTestApp.Modules.MainModule.Views.LogPage"
  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:hc="https://handyorg.github.io/handycontrol"
  7. xmlns:local="clr-namespace:LogoForceTestApp.Modules.MainModule.Views"
  8. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9. xmlns:viewmodels="clr-namespace:LogoForceTestApp.Modules.MainModule.ViewModels"
  10. d:DataContext="{d:DesignInstance Type=viewmodels:LogPageViewModel}"
  11. d:DesignHeight="450"
  12. d:DesignWidth="800"
  13. mc:Ignorable="d">
  14. <Grid>
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="auto" />
  17. <RowDefinition />
  18. <RowDefinition Height="auto" />
  19. </Grid.RowDefinitions>
  20. <StackPanel Orientation="Horizontal">
  21. <hc:DatePicker
  22. Margin="4,0"
  23. hc:InfoElement.Title="选择开始时间"
  24. SelectedDate="{Binding SelectedStartDate}" />
  25. <hc:DatePicker
  26. Margin="4,0"
  27. hc:InfoElement.Title="选择结束时间"
  28. SelectedDate="{Binding SelectedEndDate}" />
  29. <Button
  30. Margin="4,0"
  31. VerticalAlignment="Bottom"
  32. Command="{Binding QueryCommand}"
  33. Content="查询" />
  34. </StackPanel>
  35. <DataGrid
  36. Grid.Row="1"
  37. AutoGenerateColumns="False"
  38. IsReadOnly="True"
  39. ItemsSource="{Binding LogModels}">
  40. <DataGrid.Columns>
  41. <DataGridTextColumn Binding="{Binding Id}" Header="ID" />
  42. <DataGridTextColumn Binding="{Binding Timestamp}" Header="时间" />
  43. <DataGridTextColumn Binding="{Binding Properties}" Header="日志" />
  44. </DataGrid.Columns>
  45. </DataGrid>
  46. <hc:Pagination
  47. Grid.Row="2"
  48. HorizontalAlignment="Center"
  49. IsJumpEnabled="True"
  50. MaxPageCount="{Binding MaxCount}"
  51. PageIndex="{Binding PageIndex}">
  52. <hc:Interaction.Triggers>
  53. <hc:EventTrigger EventName="PageUpdated">
  54. <hc:EventToCommand Command="{Binding PageUpdatedCmd}" PassEventArgsToCommand="True" />
  55. </hc:EventTrigger>
  56. </hc:Interaction.Triggers>
  57. </hc:Pagination>
  58. </Grid>
  59. </UserControl>