Browse Source

законченая форма 3ad7

Ethosa 3 years ago
parent
commit
c44a5ae022
4 changed files with 16 additions and 5 deletions
  1. 1 1
      MainWindow.xaml
  2. 4 1
      MainWindow.xaml.cs
  3. 3 3
      Pages/AuthPage.xaml
  4. 8 0
      Pages/AuthPage.xaml.cs

+ 1 - 1
MainWindow.xaml

@@ -14,6 +14,6 @@
         </Grid.RowDefinitions>
         <Rectangle Fill="#FFF4F4F5" Grid.Row="2" StrokeThickness="0" Height="42" VerticalAlignment="Center"/>
         <Button Content="назад" HorizontalAlignment="Left" Margin="18,0,0,0" VerticalAlignment="Center" Height="22" Width="76"/>
-        <Frame x:Name="MainFrame" Content="Frame" Grid.Row="1"/>
+        <Frame x:Name="MainFrame" Source="Pages/AuthPage.xaml" Grid.Row="1" />
     </Grid>
 </Window>

+ 4 - 1
MainWindow.xaml.cs

@@ -29,5 +29,8 @@ namespace bebra
         {
 
         }
-    }
+
+        
+
+}
 }

+ 3 - 3
Pages/AuthPage.xaml

@@ -21,10 +21,10 @@
             <ColumnDefinition Width="1*"/>
         </Grid.ColumnDefinitions>
         <Label Content="логин" HorizontalAlignment="Center" Margin="0,37,0,0" VerticalAlignment="Top" Height="19" Width="50" Grid.Column="1" Grid.RowSpan="2"/>
-        <TextBox HorizontalAlignment="Center" Margin="0,37,0,0" Text="TextBox" TextWrapping="Wrap" VerticalAlignment="Top" Width="170" Grid.Column="2" Height="19" Grid.RowSpan="2"/>
+        <TextBox x:Name="TextBoxLogin" HorizontalAlignment="Center" Margin="0,37,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="170" Grid.Column="2" Height="19" Grid.RowSpan="2"/>
         <Label Content="Пароль" HorizontalAlignment="Center" Margin="0,30,0,0" VerticalAlignment="Top" Height="19" Width="50" Grid.Column="1" Grid.Row="1"/>
-        <TextBox HorizontalAlignment="Center" Margin="0,30,0,0" Text="TextBox" TextWrapping="Wrap" VerticalAlignment="Top" Width="170" Grid.Column="2" Height="19" Grid.Row="1"/>
-        <Button Content="Вход" Grid.Column="2" HorizontalAlignment="Center" Margin="0,72,0,0" Grid.Row="1" VerticalAlignment="Top" Width="170"/>
+        <PasswordBox x:Name="PasswordBox" HorizontalAlignment="Center" Margin="0,30,0,0" Password="" VerticalAlignment="Top" Width="170" Grid.Column="2" Height="19" Grid.Row="1"/>
+        <Button Click="ButtonEnter_OnClick" Content="Вход" Grid.Column="2" HorizontalAlignment="Center" Margin="0,72,0,0" Grid.Row="1" VerticalAlignment="Top" Width="170" />
         <Button Content="Регистрация" Grid.Column="2" HorizontalAlignment="Center" Grid.Row="1" VerticalAlignment="Center" Width="170"/>
 
     </Grid>

+ 8 - 0
Pages/AuthPage.xaml.cs

@@ -22,5 +22,13 @@ namespace bebra.Pages
         {
             InitializeComponent();
         }
+        private void ButtonEnter_OnClick(object sender, RoutedEventArgs e)
+        { if (string.IsNullOrEmpty(TextBoxLogin.Text) || string.IsNullOrEmpty(PasswordBox.Password))
+            {
+                MessageBox.Show("введите логин и пароль!");
+                return;
+            }
+}
+
     }
 }