急诊紧急开锁添加退出按钮
This commit is contained in:
		
							parent
							
								
									9539e2b96c
								
							
						
					
					
						commit
						e346203c96
					
				| 
						 | 
					@ -10,6 +10,7 @@ using Prism.Regions;
 | 
				
			||||||
using System;
 | 
					using System;
 | 
				
			||||||
using System.Collections;
 | 
					using System.Collections;
 | 
				
			||||||
using System.Collections.Generic;
 | 
					using System.Collections.Generic;
 | 
				
			||||||
 | 
					using System.Diagnostics;
 | 
				
			||||||
using System.Linq;
 | 
					using System.Linq;
 | 
				
			||||||
using System.Text;
 | 
					using System.Text;
 | 
				
			||||||
using System.Threading.Tasks;
 | 
					using System.Threading.Tasks;
 | 
				
			||||||
| 
						 | 
					@ -59,6 +60,13 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
					                _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
				
			||||||
            });
 | 
					            });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        private DelegateCommand? _exitCommand;
 | 
				
			||||||
 | 
					        public DelegateCommand ExitCommand => _exitCommand ??= new DelegateCommand(Exit);
 | 
				
			||||||
 | 
					        void Exit()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Process.GetCurrentProcess().Kill();
 | 
				
			||||||
 | 
					            Environment.Exit(0);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        //间隔1分钟查询数据库连接状态
 | 
					        //间隔1分钟查询数据库连接状态
 | 
				
			||||||
        private void CheckDBConnect()
 | 
					        private void CheckDBConnect()
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -81,8 +81,10 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
                    _regionManager.RequestNavigate("MainRegion", "EmergencyWindow");
 | 
					                    _regionManager.RequestNavigate("MainRegion", "EmergencyWindow");
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                else
 | 
					                else
 | 
				
			||||||
 | 
					                {
 | 
				
			||||||
                    _container.RegisterType<object, LoginWindow>("LoginWindow");
 | 
					                    _container.RegisterType<object, LoginWindow>("LoginWindow");
 | 
				
			||||||
                    _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
					                    _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
				
			||||||
 | 
					                }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }));
 | 
					            }));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -36,7 +36,7 @@
 | 
				
			||||||
                    <RowDefinition Height="200" />
 | 
					                    <RowDefinition Height="200" />
 | 
				
			||||||
                    <RowDefinition />
 | 
					                    <RowDefinition />
 | 
				
			||||||
                </Grid.RowDefinitions>
 | 
					                </Grid.RowDefinitions>
 | 
				
			||||||
                <Grid Grid.Row="1" Height="470" Margin="0 50 0 0">
 | 
					                <Grid Grid.Row="1" Height="430" Margin="0 20 0 0">
 | 
				
			||||||
                    <Grid.RowDefinitions>
 | 
					                    <Grid.RowDefinitions>
 | 
				
			||||||
                        <RowDefinition />
 | 
					                        <RowDefinition />
 | 
				
			||||||
                        <RowDefinition />
 | 
					                        <RowDefinition />
 | 
				
			||||||
| 
						 | 
					@ -69,9 +69,18 @@
 | 
				
			||||||
                    <RowDefinition Height="Auto"/>
 | 
					                    <RowDefinition Height="Auto"/>
 | 
				
			||||||
                    <RowDefinition Height="Auto"/>
 | 
					                    <RowDefinition Height="Auto"/>
 | 
				
			||||||
                </Grid.RowDefinitions>
 | 
					                </Grid.RowDefinitions>
 | 
				
			||||||
                <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
 | 
					                <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="16 0 0 0">
 | 
				
			||||||
                    <Button  Margin="0 0 6 0" Content="返回登录" Command="{Binding ReturnLoginDelegate}" CommandParameter="0"
 | 
					                    <Button  Margin="0 0 6 0" Content="返回登录" Command="{Binding ReturnLoginDelegate}" CommandParameter="0"
 | 
				
			||||||
                    Visibility="{Binding DBConnectionStatus, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignOutlinedLightButton}"/>
 | 
					                    Visibility="{Binding DBConnectionStatus, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource MaterialDesignOutlinedLightButton}"/>
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
 | 
					                    <Button
 | 
				
			||||||
 | 
					                          Style="{StaticResource MaterialDesignRaisedLightButton}"
 | 
				
			||||||
 | 
					                          Background="#7986cb"
 | 
				
			||||||
 | 
					                          BorderBrush="#7986cb"
 | 
				
			||||||
 | 
					                          materialDesign:ButtonAssist.CornerRadius="5" Cursor="Hand" IsCancel="true" 
 | 
				
			||||||
 | 
					                          Command="{ Binding ExitCommand }" >       
 | 
				
			||||||
 | 
					                        <TextBlock Foreground="{DynamicResource MaterialDesignPaper}" Text="退出" />
 | 
				
			||||||
 | 
					                    </Button>
 | 
				
			||||||
                </StackPanel>
 | 
					                </StackPanel>
 | 
				
			||||||
                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="1">
 | 
					                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Grid.Row="1">
 | 
				
			||||||
                    <GroupBox Width="800px"
 | 
					                    <GroupBox Width="800px"
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue