public partial class MainWindow : Window
    {
        AppContext db;
        public RefgistrationUch()
        {
            InitializeComponent();
            db = new AppContext();
        }

        private void Button_Reg_Click(object sender, RoutedEventArgs e)
        {
            string login = Login.Text.Trim();
            string pas1 = pass1.Password.Trim();
            string pas2= pass2.Password.Trim();
            string mail = email.Text.Trim();
            if(login.Length < 5)
            {
                Login.ToolTip = "Это поле введено не корректно";
                Login.Background = Brushes.Gray;
            }
            else 
            {
                Login.ToolTip = "";
                Login.Background = Brushes.Transparent;
            }
            if(pas1.Length < 5)
            {
                pass1.ToolTip = "Это поле введено не корректно";
                pass1.Background = Brushes.Gray;
            }
            else
            {
                pass1.ToolTip = "";
                pass1.Background = Brushes.Transparent;
            }
            if (pas1 != pas2)
            {
                pass2.ToolTip = "Это поле введено не корректно";
                pass2.Background = Brushes.Gray;
            }
            else
            {
                pass2.ToolTip = "";
                pass2.Background = Brushes.Transparent;
            }
            if (!mail.Contains("@")||!mail.Contains("."))
            {
                email.ToolTip = "Это поле введено не корректно";
                email.Background = Brushes.Gray;
            }
            else
            {
                email.ToolTip = "";
                email.Background = Brushes.Transparent;
            }
            uchenik uchenik = new uchenik(login,pas1,mail);
            db.ucheniki.Add(uchenik);
            db.SaveChanges();
        }



class uchenik
    {
        public int id { get; set; }
        private string login, email,password;
        public string Login
        {
            get { return login; }
            set { login = value; }
        }
        public string Email
        {
            get { return email; }
            set { email = value; }
        }
        public string Password
        {
            get { return password; }
            set { password = value; }
        }
        public uchenik()
        {

        }
        public uchenik(string login,string email,string password)
        {
            this.login = login;
            this.email = email;
            this.password = password;
        }

    }





Window x:Class="kursach_mukha_692.RegistrationUch"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:kursach_mukha_692"
        mc:Ignorable="d"
        xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        Title="Авторизация" Height="600" Width="450" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    <Grid Background="#028E9B">
        <Border MinWidth="400" MaxWidth="400" Margin="15" Background="#35C0CD" VerticalAlignment="Center" Padding="30">
            <StackPanel>
                <TextBlock Text="Привет" FontSize="100" Margin="0 0 0 20"/>
                <Grid Margin="0 0 0 20">
                    <Button HorizontalAlignment="Left"  Content="Регистрация"/>
                    <Button HorizontalAlignment="Right" Content="Войти" />
                </Grid>
                <TextBox x:Name ="Login" materialDesign:HintAssist.Hint="Введите логин" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
                <PasswordBox x:Name ="pass1" materialDesign:HintAssist.Hint="Введите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
                <PasswordBox x:Name ="pass2" materialDesign:HintAssist.Hint="Повторите пароль" Style="{StaticResource MaterialDesignFloatingHintPasswordBox}"/>
                <TextBox x:Name ="email" materialDesign:HintAssist.Hint="Email" Style="{StaticResource MaterialDesignFloatingHintTextBox}"/>
                <Button Content="Зарегистироваться" Margin="0 20" Click="Button_Reg_Click" />
            </StackPanel>
        </Border>
    </Grid>
</Window>



<Application x:Class="kursach_mukha_692.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:kursach_mukha_692"
             StartupUri="MainWindow.xaml">
    <Application.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.DeepPurple.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Lime.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Application.Resources>
</Application>



<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<configSections>
		<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
		<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
	</configSections>
	<!-- Если не работает, то сделайте следующее. Замените все содержимое файла, но объект startup установите такой же, как был у вас ранее  -->
	<startup>
		<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
	</startup>
	<connectionStrings>
		<add name="DefaultConnection" connectionString="Data Source=.\DB kursovoy mukha.db" providerName="System.Data.SQLite" />
	</connectionStrings>
	<entityFramework>
		<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
			<parameters>
				<parameter value="v11.0" />
			</parameters>
		</defaultConnectionFactory>
		<providers>
			<provider invariantName="System.Data.SQLite"  type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
			<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
			<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
		</providers>
	</entityFramework>
	<system.data>
		<DbProviderFactories>
			<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
			<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
		</DbProviderFactories>
	</system.data>
</configuration>




<?xml version="1.0" encoding="utf-8"?>
<packages>
  <package id="EntityFramework" version="6.4.4" targetFramework="net472" />
  <package id="MaterialDesignColors" version="2.0.3" targetFramework="net472" />
  <package id="MaterialDesignThemes" version="4.2.1" targetFramework="net472" />
  <package id="Stub.System.Data.SQLite.Core.NetFramework" version="1.0.115.0" targetFramework="net472" />
  <package id="System.Data.SQLite" version="1.0.115.0" targetFramework="net472" />
  <package id="System.Data.SQLite.Core" version="1.0.115.0" targetFramework="net472" />
  <package id="System.Data.SQLite.EF6" version="1.0.115.0" targetFramework="net472" />
  <package id="System.Data.SQLite.Linq" version="1.0.115.0" targetFramework="net472" />
</packages>



xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
        mc:Ignorable="d" 
        Title="Авторизация" Height="150" Width="200" WindowStartupLocation="CenterScreen" VerticalAlignment="Bottom" HorizontalAlignment="Stretch" ScrollViewer.HorizontalScrollBarVisibility="Disabled">
    <Grid Background="#028E9B">
        <Grid Margin="20 20 20 20">
        <Button VerticalAlignment="Top"  Content="Регистрация" />
        <Button VerticalAlignment="Center" Content="Войти как ученик" />
        <Button VerticalAlignment="Bottom" Content="Войти как преподаватель"/>
        </Grid>
    </Grid>












