EditTestPage.xaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. <Page x:Class="MyTests.Pages.EditTestPage"
  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. Background="{StaticResource color1}">
  11. <Grid>
  12. <Grid.RowDefinitions>
  13. <RowDefinition Height="50"/>
  14. <RowDefinition/>
  15. <RowDefinition Height="50"/>
  16. </Grid.RowDefinitions>
  17. <StackPanel Orientation="Horizontal">
  18. <Image Name="TestImg"
  19. MinHeight="35"
  20. MinWidth="35"
  21. Source="/MyTests;component/Resources/Approval.png"
  22. Margin="7"
  23. MouseDown="TestImg_MouseDown">
  24. </Image>
  25. <TextBox Name="TestNameBox"
  26. Text="Тест"
  27. FontSize="25"
  28. BorderBrush="{x:Null}"
  29. LostFocus="TestNameBox_LostFocus">
  30. </TextBox>
  31. <Label Content=" - редактирование"
  32. FontSize="25"
  33. Foreground="LightGray"
  34. Opacity="0.5">
  35. </Label>
  36. </StackPanel>
  37. <ScrollViewer Grid.Row="1">
  38. <StackPanel>
  39. <StackPanel Orientation="Horizontal">
  40. <Label Content="Тест виден другим пользователям:"
  41. FontSize="14"/>
  42. <CheckBox Name="IsVisibleCB"
  43. VerticalContentAlignment="Center"
  44. Click="SaveInfoCB">
  45. </CheckBox>
  46. </StackPanel>
  47. <StackPanel Orientation="Horizontal">
  48. <Label Content="Пользователь может посмотреть свои ответы:"
  49. FontSize="14"/>
  50. <CheckBox Name="IsAnswersVisibleCB"
  51. VerticalContentAlignment="Center"
  52. Click="SaveInfoCB">
  53. </CheckBox>
  54. </StackPanel>
  55. <StackPanel Orientation="Horizontal">
  56. <Label Content="Пользователь может пройти тест повторно:"
  57. FontSize="14"/>
  58. <CheckBox Name="CanAgainCB"
  59. VerticalContentAlignment="Center"
  60. Click="SaveInfoCB">
  61. </CheckBox>
  62. </StackPanel>
  63. <StackPanel Orientation="Horizontal"
  64. Height="30"
  65. Margin="0,10,0,10">
  66. <Button Content="Добавить вопрос"
  67. Width="300"
  68. Margin="15,0,15,0"
  69. Click="AddQuestionButton_Click"/>
  70. <Button Content="Удалить вопрос"
  71. Width="300"
  72. Margin="15,0,15,0"
  73. Click="DeleteQuestionButton_Click"/>
  74. </StackPanel>
  75. <ListBox Name="QuestionsListBox"
  76. Grid.Row="1"
  77. Background="{StaticResource color1}"
  78. BorderBrush="{x:Null}"
  79. SelectionChanged="QuestionsListBox_SelectionChanged"
  80. ScrollViewer.HorizontalScrollBarVisibility="Disabled"
  81. ScrollViewer.VerticalScrollBarVisibility="Hidden">
  82. <ListBox.ItemTemplate>
  83. <DataTemplate>
  84. <Border Width="{Binding Path=ActualWidth, ElementName=QuestionsListBox}"
  85. Height="45"
  86. CornerRadius="10"
  87. Background="{StaticResource color2}">
  88. <StackPanel Orientation="Horizontal">
  89. <Image Width="30"
  90. Height="30"
  91. Margin="10,5,5,5"
  92. HorizontalAlignment="Left"
  93. Source="/MyTests;component/Resources/Question-mark.png">
  94. </Image>
  95. <StackPanel>
  96. <Label Content="{Binding Content}"/>
  97. <TextBlock Margin="5,-6,0,0">
  98. <Run Text="Ответ: " Foreground="LightGray"/>
  99. <Run Text="{Binding Answer}" />
  100. </TextBlock>
  101. </StackPanel>
  102. </StackPanel>
  103. </Border>
  104. </DataTemplate>
  105. </ListBox.ItemTemplate>
  106. </ListBox>
  107. </StackPanel>
  108. </ScrollViewer>
  109. <Button Grid.Row="2"
  110. Content="Назад"
  111. Width="120"
  112. Height="40"
  113. FontSize="20"
  114. Click="BackButton_Click">
  115. </Button>
  116. </Grid>
  117. </Page>