ltwork преди 1 година
родител
ревизия
e6f04c9a56

+ 21 - 15
BlankApp1/BlankApp1/App.xaml.cs

@@ -28,6 +28,7 @@ using SqlSugar;
 using System;
 using System.Configuration;
 using System.Data;
+using System.Diagnostics;
 using System.IO;
 using System.Reflection;
 using System.Windows;
@@ -139,24 +140,29 @@ namespace BlankApp1
         /// <param name="containerProvider"></param>
         public static void LoginOut(IContainerProvider containerProvider)
         {
-            Current.MainWindow.Hide();
+            //Current.MainWindow.Hide();
 
-            var dialog = containerProvider.Resolve<IDialogService>();
+            //var dialog = containerProvider.Resolve<IDialogService>();
 
-            dialog.ShowDialog("LoginView", callback =>
-            {
-                if (callback.Result != ButtonResult.OK)
-                {
-                    Environment.Exit(0);
-                    return;
-                }
+            //dialog.ShowDialog("LoginView", callback =>
+            //{
+            //    if (callback.Result != ButtonResult.OK)
+            //    {
+            //        Environment.Exit(0);
+            //        return;
+            //    }
 
-                //调试发现service为MainViewModel
-                var service = App.Current.MainWindow.DataContext as IConfigureService;
-                if (service != null)
-                    service.Configure();
-                Current.MainWindow.Show();
-            });
+        
+            //});
+
+            // 关闭当前窗口
+            Current.MainWindow.Close();
+            string exePath=System.AppDomain.CurrentDomain.BaseDirectory + "PLCTool.exe";
+            System.Diagnostics.Process.Start(exePath);
+            // 获取当前exe文件的路径
+          
+
+         
         }
 
     }

+ 1 - 0
BlankApp1/BlankApp1/ViewModels/MainWindowViewModel.cs

@@ -65,6 +65,7 @@ namespace BlankApp1.ViewModels
 
         private void LoginOut(object obj)
         {
+           
             App.LoginOut(_containerProvider);
         }
 

+ 1 - 1
BlankApp1/BlankApp1/Views/MainWindow.xaml

@@ -115,7 +115,7 @@
                
                 <Menu VerticalAlignment="Center" Width="auto">
                     <MenuItem Header="{Binding UserName}" Width="auto">
-                        <!--<MenuItem Header="注销" Width="60" Command="{Binding LoginOutCommand}"/>-->
+                        <MenuItem Header="注销" Width="60" Command="{Binding LoginOutCommand}"/>
                     </MenuItem>
                 </Menu>
                 <TextBlock Text="|" Style="{StaticResource txtHeadStyle}" Margin="0,0,17,0" Width="2" Height=" 20"></TextBlock>

+ 3 - 3
BlankApp1/BlankApp1/Views/SystemManageView/MenuManageView.xaml

@@ -26,11 +26,11 @@
                 <Button Content="查询" Width="80"  Margin="5,0"  Command="{Binding QueryCommand}" Style="{StaticResource NormalButtonStyle}" />
             </StackPanel>
 
-            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
+            <!--<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                 <Button Content="新增" Width="80"  Margin="5,0,20,0"  Command="{Binding AddCommand}" Style="{StaticResource NormalButtonStyle}" Background="#00BFBF"/>
-                <!--<Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" Style="{StaticResource NormalButtonStyle}" />-->
+                --><!--<Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" Style="{StaticResource NormalButtonStyle}" />--><!--
 
-            </StackPanel>
+            </StackPanel>-->
 
 
         </UniformGrid>