Quellcode durchsuchen

ЖЕЕЕЕСТЬБ

Danila Alekseev vor 1 Jahr
Ursprung
Commit
74282713f8

+ 2 - 2
ROGOZ/MainWindow.xaml

@@ -45,14 +45,14 @@
 
             <StackPanel Width="280" Height="400" Margin="0,20,0,0">
 
-                <Button Name="General" Style="{DynamicResource NaviButtons}">
+                <Button Name="General" Style="{DynamicResource NaviButtons}" Click="General_Click">
                     <Grid Width="280">
                         <Image Source="/Resources/GeneralHome.png" Style="{StaticResource ImageStyle}"/>
                         <TextBlock Text="Главная" Style="{StaticResource Text_Style}"/>
                     </Grid>
                 </Button>
                 <Separator Height="20" Background="Transparent"/>
-                <Button Name="TaskList" Style="{DynamicResource NaviButtons}">
+                <Button Name="TaskList" Style="{DynamicResource NaviButtons}" Click="TaskList_Click">
                     <Grid Width="280">
                         <TextBlock Text="Задачи" Style="{StaticResource Text_Style}"/>
                         <Image Source="/Resources/TaskList.png" Style="{StaticResource ImageStyle}"/>

+ 20 - 7
ROGOZ/MainWindow.xaml.cs

@@ -24,7 +24,7 @@ namespace ROGOZ
         public MainWindow()
         {
             InitializeComponent();
-            MainFrame.Navigate(new Pages.TaskList());
+            MainFrame.Navigate(new Pages.General());
         }
 
         private void Window_MouseDown(object sender, MouseButtonEventArgs e)
@@ -44,13 +44,26 @@ namespace ROGOZ
 
         private void AccExit_Click(object sender, RoutedEventArgs e)
         {
-            if (MessageBox.Show("Вы уверены, что хотите выйти из аккаунта ESOFT?", "Выйти", MessageBoxButton.YesNo, MessageBoxImage.Question)==MessageBoxResult.Yes)
-            {
-                Pages.Authorization authorization = new Pages.Authorization();
-                authorization.Show();
-                this.Close();
-            }
+            //if (MessageBox.Show("Вы уверены, что хотите выйти из аккаунта ESOFT?", "Выйти", MessageBoxButton.YesNo, MessageBoxImage.Question)==MessageBoxResult.Yes)
+            //{
+            //    Pages.Authorization authorization = new Pages.Authorization();
+            //    authorization.Show();
+            //    this.Close();
+            //}
+
+            Windows.AccExitWin window = new Windows.AccExitWin();
+            window.ShowDialog();
             
         }
+
+        private void General_Click(object sender, RoutedEventArgs e)
+        {
+            MainFrame.Navigate(new Pages.General());
+        }
+
+        private void TaskList_Click(object sender, RoutedEventArgs e)
+        {
+            MainFrame.Navigate(new Pages.TaskList());
+        }
     }
 }

+ 14 - 0
ROGOZ/Pages/General.xaml

@@ -0,0 +1,14 @@
+<Page x:Class="ROGOZ.Pages.General"
+      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
+      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
+      xmlns:local="clr-namespace:ROGOZ.Pages"
+      mc:Ignorable="d" 
+      d:DesignHeight="630" d:DesignWidth="820"
+      Title="General">
+
+    <Grid>
+        <TextBlock Text="Это главная страница и здесь пока ничего нет ☹" Style="{StaticResource BlockHeader}" TextWrapping="Wrap" Width="700"/>
+    </Grid>
+</Page>

+ 28 - 0
ROGOZ/Pages/General.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace ROGOZ.Pages
+{
+    /// <summary>
+    /// Логика взаимодействия для General.xaml
+    /// </summary>
+    public partial class General : Page
+    {
+        public General()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 14 - 0
ROGOZ/ROGOZ.csproj

@@ -98,12 +98,18 @@
     <Compile Include="Pages\AddTask.xaml.cs">
       <DependentUpon>AddTask.xaml</DependentUpon>
     </Compile>
+    <Compile Include="Pages\General.xaml.cs">
+      <DependentUpon>General.xaml</DependentUpon>
+    </Compile>
     <Compile Include="Task.cs">
       <DependentUpon>Model1.tt</DependentUpon>
     </Compile>
     <Compile Include="User.cs">
       <DependentUpon>Model1.tt</DependentUpon>
     </Compile>
+    <Compile Include="Windows\AccExitWin.xaml.cs">
+      <DependentUpon>AccExitWin.xaml</DependentUpon>
+    </Compile>
     <Page Include="Dictionary.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
@@ -128,10 +134,18 @@
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Pages\General.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
     <Page Include="Pages\TaskList.xaml">
       <SubType>Designer</SubType>
       <Generator>MSBuild:Compile</Generator>
     </Page>
+    <Page Include="Windows\AccExitWin.xaml">
+      <SubType>Designer</SubType>
+      <Generator>MSBuild:Compile</Generator>
+    </Page>
   </ItemGroup>
   <ItemGroup>
     <Compile Include="Model1.Context.cs">

+ 31 - 0
ROGOZ/Windows/AccExitWin.xaml

@@ -0,0 +1,31 @@
+<Window x:Class="ROGOZ.Windows.AccExitWin"
+        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:ROGOZ.Windows"
+        mc:Ignorable="d"
+        Title="AccExitWin" Height="310" Width="600"
+        WindowStyle="None"
+        WindowStartupLocation="CenterScreen"
+        ResizeMode="NoResize"
+        MouseDown="Window_MouseDown"
+        Background="Transparent">
+
+    <Border CornerRadius="15" Background="#e6f4ff">
+        <Grid>
+            <Label Content="Выйти" Style="{StaticResource LabelStyle}" FontSize="35" Margin="10,10,0,0" Height="55" Width="120" HorizontalAlignment="Left" VerticalAlignment="Top"/>
+            <Button x:Name="btnClose" Style="{DynamicResource PanelButtonX}" Margin="0,10,10,0" Height="30" Width="30" Click="btnClose_Click" >
+                <Image Source="/Resources/Cross1.png"  IsHitTestVisible="False"/>
+            </Button>
+            <TextBlock Text="Вы собираетесь выйти из аккаунта ESOFT. Вам потребуется заново ввести ваши логин и пароль, чтобы снова войти в ESOFT" Style="{StaticResource Text_Style}" TextWrapping="Wrap" Foreground="Black" FontSize="25" Margin="15,0,15,0" />
+
+            <StackPanel VerticalAlignment="Bottom" Margin="10" Orientation="Horizontal" HorizontalAlignment="Right" Width="450">
+                <Button Content="Подтвердить" Style="{StaticResource AuthoButtons}" Width="200" FontSize="25" BorderThickness="0" Margin="0,0,30,0" Click="Button_Click_1"/>
+                <Button Content="Отмена" Style="{StaticResource AuthoButtons}" Width="200" FontSize="25" Background="Gray" BorderThickness="0" Click="Button_Click"/>
+            </StackPanel>
+
+        </Grid>
+    </Border>
+    
+</Window>

+ 54 - 0
ROGOZ/Windows/AccExitWin.xaml.cs

@@ -0,0 +1,54 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Shapes;
+
+namespace ROGOZ.Windows
+{
+    /// <summary>
+    /// Логика взаимодействия для AccExitWin.xaml
+    /// </summary>
+    public partial class AccExitWin : Window
+    {
+        public AccExitWin()
+        {
+            InitializeComponent();
+        }
+
+        private void btnClose_Click(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+
+        private void Window_MouseDown(object sender, MouseButtonEventArgs e)
+        {
+            if (e.LeftButton == MouseButtonState.Pressed) { DragMove(); }
+        }
+
+        private void Button_Click(object sender, RoutedEventArgs e)
+        {
+            this.Close();
+        }
+
+        private void Button_Click_1(object sender, RoutedEventArgs e)
+        {
+            //Pages.Authorization authorization = new Pages.Authorization();
+            //authorization.Show();
+            //this.Close();
+            //Application.Current.Shutdown();
+            Pages.Authorization authorization = new Pages.Authorization();
+            authorization.Show();
+            Application.Current.ShutdownMode = ShutdownMode.OnMainWindowClose;
+
+        }
+    }
+}