TestPage.xaml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <Page x:Class="MyTests.Pages.TestPage"
  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="676">
  10. <Grid Background="{StaticResource color1}">
  11. <Grid.RowDefinitions>
  12. <RowDefinition Height="50"/>
  13. <RowDefinition/>
  14. </Grid.RowDefinitions>
  15. <StackPanel Orientation="Horizontal"
  16. HorizontalAlignment="Left">
  17. <Image Name="TestImg"
  18. Source="/MyTests;component/Resources/Approval.png"
  19. Margin="7">
  20. </Image>
  21. <Label Name="TestName"
  22. Content="Название теста"
  23. FontSize="25">
  24. </Label>
  25. </StackPanel>
  26. <StackPanel Orientation="Horizontal"
  27. HorizontalAlignment="Right">
  28. <Label Content="by"
  29. FontSize="25">
  30. </Label>
  31. <Image Name="AuthorImg"
  32. Source="/MyTests;component/Resources/StandartImage.png"
  33. Margin="7">
  34. </Image>
  35. <Label Name="AuthorName"
  36. Content="Автор"
  37. FontSize="25"
  38. MouseDown="AuthorName_MouseDown">
  39. </Label>
  40. </StackPanel>
  41. <ListBox Name="TestsListBox"
  42. Background="{StaticResource color1}"
  43. BorderBrush="{Binding TestsListBox}"
  44. Grid.Row="1">
  45. <ScrollViewer VerticalScrollBarVisibility="Visible"/>
  46. <ListBox.ItemTemplate>
  47. <DataTemplate>
  48. <Border Width="{Binding Path=ActualWidth, ElementName=TestsListBox}"
  49. Height="50"
  50. CornerRadius="10"
  51. Background="{StaticResource color2}">
  52. <StackPanel>
  53. <Label Content="{Binding Questions.Content}"/>
  54. <TextBlock>
  55. <Run Text="Ответ: " Foreground="LightGray"/>
  56. <Run Text="{Binding Answer}" Foreground="White"/>
  57. </TextBlock>
  58. </StackPanel>
  59. </Border>
  60. </DataTemplate>
  61. </ListBox.ItemTemplate>
  62. </ListBox>
  63. </Grid>
  64. </Page>