diff --git a/DM_Weight/ViewModels/HomeWindowViewModel.cs b/DM_Weight/ViewModels/HomeWindowViewModel.cs index 0b7ad4f..1e79d85 100644 --- a/DM_Weight/ViewModels/HomeWindowViewModel.cs +++ b/DM_Weight/ViewModels/HomeWindowViewModel.cs @@ -258,18 +258,34 @@ namespace DM_Weight.ViewModels } } - private DelegateCommand _selectionCommon; - public DelegateCommand SelectionCommon + private DelegateCommand _selectionCommon; + public DelegateCommand SelectionCommon { - get => _selectionCommon ?? (_selectionCommon = new DelegateCommand(SelectionMethod)); + get => _selectionCommon ?? (_selectionCommon = new DelegateCommand(SelectionMethod)); } - private void SelectionMethod(ListBox viewName) + private void SelectionMethod() { - SelectedMenu = viewName.SelectedItem as PremissionDm; - if (SelectedMenu.PremissionName == "退出") - { + //SelectedMenu = viewName.SelectedItem as PremissionDm; + //if (SelectedMenu.PremissionName == "退出") + //{ - _chkFunction.HIKStopDVRRecord(); + // _chkFunction.HIKStopDVRRecord(); + // logger.Info($"用户【{Operator?.Nickname}】退出登录"); + // Operator = null; + // Reviewer = null; + // _regionManager.RequestNavigate("MainRegion", "LoginWindow"); + //} + //else + //{ + // //SelectedMenu.Children = SelectedMenu.Children; + // // SelectedChildMenu = SelectedMenu.Children[0]; + // if (!_portUtil.Operate) + // { + // _regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath); + // } + //} + if (SelectedMenu != null && SelectedMenu.PremissionName == "退出") + { logger.Info($"用户【{Operator?.Nickname}】退出登录"); Operator = null; Reviewer = null; @@ -278,7 +294,7 @@ namespace DM_Weight.ViewModels else { //SelectedMenu.Children = SelectedMenu.Children; - // SelectedChildMenu = SelectedMenu.Children[0]; + //SelectedChildMenu = SelectedMenu.Children[0]; if (!_portUtil.Operate) { _regionManager.RequestNavigate("ContentRegion", SelectedMenu.Children[0].PremissionPath); diff --git a/DM_Weight/Views/HomeWindow.xaml b/DM_Weight/Views/HomeWindow.xaml index 9acd680..2b2bda4 100644 --- a/DM_Weight/Views/HomeWindow.xaml +++ b/DM_Weight/Views/HomeWindow.xaml @@ -27,10 +27,10 @@ - + - +