TestsCatalog.xaml 4.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <Page x:Class="MyTests.Pages.TestsCatalog"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  6. xmlns:local="clr-namespace:MyTests.Pages"
  7. mc:Ignorable="d"
  8. d:DesignHeight="450"
  9. d:DesignWidth="800">
  10. <Grid Background="{StaticResource color1}">
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="64"/>
  13. <RowDefinition/>
  14. </Grid.RowDefinitions>
  15. <Border CornerRadius="15"
  16. Background="{StaticResource color2}"
  17. Margin="5">
  18. <StackPanel Orientation="Horizontal"
  19. HorizontalAlignment="Center">
  20. <Button Name="AddTestButton"
  21. Height="45"
  22. Width="45"
  23. Content="+"
  24. FontSize="30"
  25. Click="AddTest_Click"
  26. Visibility="Collapsed">
  27. </Button>
  28. <StackPanel Orientation="Horizontal"
  29. Grid.Row="0"
  30. HorizontalAlignment="Center">
  31. <TextBox Name="TestNameBox"
  32. Margin="5"
  33. Width="200"
  34. FontSize="16"
  35. VerticalContentAlignment="Center"
  36. Text="Название теста"
  37. PreviewMouseDown="TestNameBox_PreviewMouseDown"
  38. LostFocus="TestNameBox_LostFocus">
  39. </TextBox>
  40. <TextBox Name="AuthorTestBox"
  41. Margin="5"
  42. Width="200"
  43. FontSize="16"
  44. VerticalContentAlignment="Center"
  45. Text="Преподаватель"
  46. PreviewMouseDown="AuthorTestBox_PreviewMouseDown"
  47. LostFocus="AuthorTestBox_LostFocus">
  48. </TextBox>
  49. </StackPanel>
  50. <Button Height="45"
  51. Width="45"
  52. Click="FindTests_Click">
  53. <Image Source="/MyTests;component/Resources/search.png"
  54. Margin="10"/>
  55. </Button>
  56. </StackPanel>
  57. </Border>
  58. <ListBox Name="TestsListBox"
  59. Grid.Row="1"
  60. Background="{StaticResource color1}"
  61. BorderBrush="{x:Null}"
  62. SelectionChanged="TestsListBox_SelectionChanged"
  63. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  64. ScrollViewer.VerticalScrollBarVisibility="Hidden">
  65. <ListBox.ItemTemplate>
  66. <DataTemplate>
  67. <Border Width="{Binding Path=ActualWidth, ElementName=TestsListBox}"
  68. Margin="-10,0,0,0"
  69. Height="45"
  70. CornerRadius="10"
  71. Background="{StaticResource color2}">
  72. <StackPanel Orientation="Horizontal">
  73. <Image Width="30"
  74. Height="30"
  75. Margin="10,5,5,5"
  76. HorizontalAlignment="Left"
  77. Source="{Binding testImage}">
  78. </Image>
  79. <StackPanel>
  80. <StackPanel Orientation="Horizontal">
  81. <Label Content="{Binding test.Name}"/>
  82. <Label Content="{Binding test.Users.Login}"/>
  83. </StackPanel>
  84. <TextBlock Margin="0,-6,0,0">
  85. <Run Text="Вопросов: " Foreground="White"/>
  86. <Run Text="{Binding test.Questions.Count, Mode=OneTime}" />
  87. </TextBlock>
  88. </StackPanel>
  89. </StackPanel>
  90. </Border>
  91. </DataTemplate>
  92. </ListBox.ItemTemplate>
  93. </ListBox>
  94. </Grid>
  95. </Page>