Imagara 2 роки тому
батько
коміт
c96739765f

+ 4 - 11
MyTests/Pages/TestPage.xaml

@@ -48,17 +48,10 @@
                             Height="50"
                             CornerRadius="10"
                             Background="{StaticResource color2}">
-                        <StackPanel Orientation="Horizontal">
-                            <Image Width="35"
-                               Height="35"
-                               Margin="5"
-                               HorizontalAlignment="Left"
-                               Source="/MyTests;component/Resources/approval.png">
-                            </Image>
-                            <StackPanel>
-                                <Label Content="{Binding Content}"/>
-                                <TextBox Text="Ответ:"/>
-                            </StackPanel>
+                        <StackPanel>
+                            <Label Content="{Binding Content}"/>
+                            <TextBox Name="Testing"
+                                     Text="Ответ:"/>
                         </StackPanel>
                     </Border>
                 </DataTemplate>

+ 3 - 2
MyTests/Pages/TestPage.xaml.cs

@@ -18,12 +18,13 @@ namespace MyTests.Pages
     public partial class TestPage : Page
     {
         int testId;
-        Tests test;
         public TestPage(int id)
         {
             InitializeComponent();
             testId = cnt.db.Tests.Where(item => item.IdTest == id).Select(item => item.IdTest).FirstOrDefault();
-            test = cnt.db.Tests.Where(item => item.IdTest == id).FirstOrDefault();
+            Tests test = cnt.db.Tests.Where(item => item.IdTest == id).FirstOrDefault();
+            TestName.Content = test.Name;
+            AuthorName.Content = test.Users.Login;
             LoadingQuestions();
         }
         void LoadingQuestions()

+ 4 - 1
MyTests/Pages/TestsCatalog.xaml.cs

@@ -50,7 +50,10 @@ namespace MyTests.Pages
             try
             {
                 if (((Tests)TestsListBox.SelectedItem) != null)
-                NavigationService.Navigate(new Pages.TestPage(((Tests)TestsListBox.SelectedItem).IdTest));
+                {
+                    NavigationService.Navigate(new Pages.TestPage(((Tests)TestsListBox.SelectedItem).IdTest));
+                    Session.openedTest = ((Tests)TestsListBox.SelectedItem).IdTest;
+                }
             }
             catch
             {

+ 2 - 0
MyTests/Session.cs

@@ -10,5 +10,7 @@ namespace MyTests
     {
         public static int userId = 1; //{ get; set; }
         public static int openedTest { get; set; }
+        public static int points = 0;
+        public static int question = 1;
     }
 }