From ebc05c28b9855bf7952990949e5c6a874f4a0037 Mon Sep 17 00:00:00 2001 From: wang-yin1 <813860776@qq.com> Date: Tue, 15 Jul 2025 15:17:04 +0800 Subject: [PATCH] 2025-07-15 15:16 --- VisionFrame/ViewModels/MainViewModel.cs | 23 ++++++++++++++++++++++- VisionFrame/Views/MainView.xaml | 8 +++++--- 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/VisionFrame/ViewModels/MainViewModel.cs b/VisionFrame/ViewModels/MainViewModel.cs index 7e9054f..8d473bb 100644 --- a/VisionFrame/ViewModels/MainViewModel.cs +++ b/VisionFrame/ViewModels/MainViewModel.cs @@ -46,7 +46,8 @@ namespace VisionFrame.ViewModels public ICommand SaveFlowCommand { get; set; } public ICommand OpenFlowCommand { get; set; } - + public ICommand MaximizeCommand { get; } + public ICommand MinimizeCommand { get; } public MainViewModel() { #region 组件列表数据初始化 @@ -184,6 +185,26 @@ namespace VisionFrame.ViewModels SaveFlowCommand = new RelayCommand(DoSaveFlow); OpenFlowCommand = new RelayCommand(DoOpenFlow); + + MaximizeCommand = new RelayCommand(() => + { + var window = Application.Current.MainWindow; + if (window.WindowState==WindowState.Normal) + { + window.WindowState = WindowState.Maximized; + } + else + { + window.WindowState = WindowState.Normal; + } + + }); + + MinimizeCommand = new RelayCommand(() => + { + var window = Application.Current.MainWindow; + window.WindowState = WindowState.Minimized; + }); } private void OnComponentItem(object obj) diff --git a/VisionFrame/Views/MainView.xaml b/VisionFrame/Views/MainView.xaml index 48859cc..203d8c1 100644 --- a/VisionFrame/Views/MainView.xaml +++ b/VisionFrame/Views/MainView.xaml @@ -8,7 +8,7 @@ WindowStartupLocation="CenterScreen" FontWeight="ExtraLight" FontSize="12" - Title="朝夕运动视觉框架" Height="750" Width="1300"> + Title="运动视觉框架" Height="750" Width="1300"> @@ -151,9 +151,11 @@