ResultMain.axaml 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="EntranseTesting.ResultMain"
  7. x:DataType="vm:MainWindowViewModel"
  8. xmlns:vm="using:EntranseTesting.ViewModels">
  9. <Grid Margin="15 0"
  10. RowDefinitions="Auto,*,Auto">
  11. <!-- Блок поиска -->
  12. <WrapPanel Orientation="Horizontal" Margin="0 5">
  13. <!-- // Поиск по группе//-->
  14. <StackPanel Orientation="Vertical" Margin="5"
  15. VerticalAlignment="Center">
  16. <TextBlock Text="Группа"
  17. VerticalAlignment="Center"/>
  18. <TextBox Text="{Binding EditorPages.Results.Group}"
  19. TextBlock.TextWrapping="NoWrap"
  20. Width="250"/>
  21. </StackPanel>
  22. <!-- // Поиск по имени //-->
  23. <StackPanel Orientation="Vertical" Margin="5"
  24. VerticalAlignment="Center">
  25. <TextBlock Text="Поиск по ФИО"
  26. VerticalAlignment="Center"/>
  27. <TextBox Text="{Binding EditorPages.Results.Fio}"
  28. TextBlock.TextWrapping="NoWrap"
  29. Width="250"/>
  30. </StackPanel>
  31. <!-- Работа с датой-->
  32. <StackPanel Orientation="Vertical"
  33. HorizontalAlignment="Center"
  34. VerticalAlignment="Center">
  35. <StackPanel Orientation="Horizontal">
  36. <TextBlock Text="С " Margin="5 0"
  37. VerticalAlignment="Center"/>
  38. <CalendarDatePicker SelectedDate="{Binding EditorPages.Results.SelectedStartDate}"
  39. DisplayDateEnd="{Binding #calendarEnd.SelectedDate}"
  40. DisplayDateStart="{Binding EditorPages.Results.StartDate}"
  41. IsTodayHighlighted="True"/>
  42. </StackPanel>
  43. <StackPanel Orientation="Horizontal" Margin="0 5 0 0">
  44. <TextBlock Text="По" Margin="5 0"
  45. VerticalAlignment="Center"/>
  46. <CalendarDatePicker Name="calendarEnd"
  47. SelectedDate="{Binding EditorPages.Results.SelectedEndDate}"
  48. DisplayDateStart="{Binding EditorPages.Results.StartDate}"
  49. DisplayDateEnd="{Binding EditorPages.Results.EndDate}"
  50. IsTodayHighlighted="True"/>
  51. </StackPanel>
  52. </StackPanel>
  53. </WrapPanel>
  54. <!-- Ответы -->
  55. <ScrollViewer HorizontalScrollBarVisibility="Auto"
  56. VerticalScrollBarVisibility="Auto" Grid.Row="1">
  57. <DataGrid ItemsSource="{Binding EditorPages.Results.Answers}"
  58. IsReadOnly="True"
  59. CanUserResizeColumns="True"
  60. CanUserReorderColumns="True"
  61. CanUserSortColumns="True">
  62. <DataGrid.Columns>
  63. <DataGridTemplateColumn>
  64. <DataGridTemplateColumn.CellTemplate>
  65. <DataTemplate>
  66. <Button Content="Подробнее" Margin="5 0"
  67. HorizontalAlignment="Center"
  68. Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).ClickToUserResult}"
  69. CommandParameter="{Binding Id}"/>
  70. </DataTemplate>
  71. </DataGridTemplateColumn.CellTemplate>
  72. </DataGridTemplateColumn>
  73. <DataGridTextColumn Header="Группа" Binding="{Binding UserGroup}"/>
  74. <DataGridTextColumn Header="ФИО" Binding="{Binding UserName}"/>
  75. <DataGridTemplateColumn Header="Оценка">
  76. <DataGridTemplateColumn.CellTemplate>
  77. <DataTemplate>
  78. <TextBlock Text="{Binding Raiting}"
  79. HorizontalAlignment="Center"
  80. VerticalAlignment="Center"
  81. Cursor="Help"
  82. ToolTip.Tip="{Binding AnswerRaiting}"/>
  83. </DataTemplate>
  84. </DataGridTemplateColumn.CellTemplate>
  85. </DataGridTemplateColumn>
  86. <DataGridTextColumn Header="Ответы" Binding="{Binding CountCorrectly}" />
  87. <DataGridTextColumn Header="Время" Binding="{Binding Time,StringFormat=hh\\:mm\\:ss}" />
  88. <DataGridTextColumn Header="Дата прохождения" Binding="{Binding Date, StringFormat={}{0:d MMMM yyyy&#x0a;HH\\:mm}}"/>
  89. </DataGrid.Columns>
  90. </DataGrid>
  91. </ScrollViewer>
  92. </Grid>
  93. </UserControl>