TestsCatalog.xaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 Height="45"
  21. Width="45"
  22. Content="+"
  23. FontSize="30"
  24. Click="AddTest_Click">
  25. </Button>
  26. <StackPanel Orientation="Horizontal"
  27. Grid.Row="0"
  28. HorizontalAlignment="Center">
  29. <TextBox Name="TestNameBox"
  30. Margin="5"
  31. Width="200"
  32. Text="Название теста">
  33. </TextBox>
  34. <TextBox Name="AuthorTestBox"
  35. Margin="5"
  36. Width="200"
  37. Text="Автор">
  38. </TextBox>
  39. </StackPanel>
  40. <Button Height="45"
  41. Width="45"
  42. Click="FindTests_Click">
  43. <Image Source="/MyTests;component/Resources/search.png"
  44. Margin="10"/>
  45. </Button>
  46. </StackPanel>
  47. </Border>
  48. <ListBox Name="TestsListBox"
  49. Grid.Row="1"
  50. Background="{StaticResource color1}"
  51. BorderBrush="{x:Null}">
  52. <ScrollViewer VerticalScrollBarVisibility="Visible"/>
  53. <ListBox.ItemTemplate>
  54. <DataTemplate>
  55. <Border Width="{Binding Path=ActualWidth, ElementName=TestsListBox}"
  56. Margin="-10,0,0,0"
  57. Height="45"
  58. CornerRadius="10"
  59. Background="{StaticResource color2}"
  60. MouseDown="TestsListBox_Selected">
  61. <StackPanel Orientation="Horizontal">
  62. <Image Width="35"
  63. Height="35"
  64. Margin="5"
  65. HorizontalAlignment="Left"
  66. Source="/MyTests;component/Resources/approval.png">
  67. </Image>
  68. <StackPanel>
  69. <StackPanel Orientation="Horizontal">
  70. <Label Content="{Binding Name}"/>
  71. <Label Content="{Binding Users.Login}"/>
  72. </StackPanel>
  73. <TextBlock Margin="0,-7,0,0">
  74. <Run Text="Вопросов: " Foreground="White"/>
  75. <Run Text="{Binding Questions.Count, Mode=OneTime}" />
  76. </TextBlock>
  77. </StackPanel>
  78. </StackPanel>
  79. </Border>
  80. </DataTemplate>
  81. </ListBox.ItemTemplate>
  82. </ListBox>
  83. </Grid>
  84. </Page>