TestsCatalog.xaml 3.8 KB

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