Browse Source

BlurEffect

mr.solder5 5 years ago
parent
commit
301dee57d6

+ 1 - 1
InteractiveKiosk/App.xaml

@@ -2,7 +2,7 @@
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:local="clr-namespace:InteractiveKiosk"
              xmlns:local="clr-namespace:InteractiveKiosk"
-             StartupUri="AuthorizationWindow.xaml">
+             StartupUri="MainWindow.xaml">
     <Application.Resources>
     <Application.Resources>
          
          
     </Application.Resources>
     </Application.Resources>

+ 1 - 3
InteractiveKiosk/AuthorizationWindow.xaml.cs

@@ -96,9 +96,7 @@ namespace InteractiveKiosk
             if (db.ParkManagers.Select(item => item.Username + " " + item.Password).Contains(username.Text + " " + password.Text))
             if (db.ParkManagers.Select(item => item.Username + " " + item.Password).Contains(username.Text + " " + password.Text))
             {
             {
                 MessageBox.Show("Добро пожаловать, вы авторизированы");
                 MessageBox.Show("Добро пожаловать, вы авторизированы");
-                //MenuWindow mw = new MenuWindow();
-                //mw.Show();
-                //this.Close();
+                this.Close();
             }
             }
             else
             else
             {
             {

+ 3 - 3
InteractiveKiosk/MainWindow.xaml

@@ -5,8 +5,8 @@
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
         xmlns:local="clr-namespace:InteractiveKiosk"
         xmlns:local="clr-namespace:InteractiveKiosk"
         mc:Ignorable="d"
         mc:Ignorable="d"
-        Title="MainWindow" Height="450" Width="800">
+        Title="MainWindow" Height="1000" Width="1000" WindowStartupLocation="CenterScreen">
     <Grid>
     <Grid>
-        
+        <Button Content="Войти" HorizontalAlignment="Left" Margin="346,321,0,0" VerticalAlignment="Top" Width="294" Click="OpenWindow" Height="137"/>
     </Grid>
     </Grid>
-</Window>
+</Window>

+ 19 - 1
InteractiveKiosk/MainWindow.xaml.cs

@@ -9,6 +9,7 @@ using System.Windows.Data;
 using System.Windows.Documents;
 using System.Windows.Documents;
 using System.Windows.Input;
 using System.Windows.Input;
 using System.Windows.Media;
 using System.Windows.Media;
+using System.Windows.Media.Effects;
 using System.Windows.Media.Imaging;
 using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 using System.Windows.Shapes;
@@ -24,5 +25,22 @@ namespace InteractiveKiosk
         {
         {
             InitializeComponent();
             InitializeComponent();
         }
         }
+
+        private void OpenWindow(object sender, RoutedEventArgs e)
+        {
+
+            this.Opacity = 0.5;
+            this.Effect = new BlurEffect();
+            AuthorizationWindow aw = new AuthorizationWindow()
+            {
+                Owner = this,
+                ShowInTaskbar = false,
+                Topmost = true
+            };
+            aw.Show();
+            this.Opacity = 1;
+            this.Effect = null;
+
+        }
     }
     }
-}
+}