2025-07-15 15:16

This commit is contained in:
wang-yin1
2025-07-15 15:17:04 +08:00
parent 6bcd09cb49
commit ebc05c28b9
2 changed files with 27 additions and 4 deletions

View File

@@ -46,7 +46,8 @@ namespace VisionFrame.ViewModels
public ICommand SaveFlowCommand { get; set; } public ICommand SaveFlowCommand { get; set; }
public ICommand OpenFlowCommand { get; set; } public ICommand OpenFlowCommand { get; set; }
public ICommand MaximizeCommand { get; }
public ICommand MinimizeCommand { get; }
public MainViewModel() public MainViewModel()
{ {
#region #region
@@ -184,6 +185,26 @@ namespace VisionFrame.ViewModels
SaveFlowCommand = new RelayCommand(DoSaveFlow); SaveFlowCommand = new RelayCommand(DoSaveFlow);
OpenFlowCommand = new RelayCommand(DoOpenFlow); 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) private void OnComponentItem(object obj)

View File

@@ -8,7 +8,7 @@
WindowStartupLocation="CenterScreen" WindowStartupLocation="CenterScreen"
FontWeight="ExtraLight" FontWeight="ExtraLight"
FontSize="12" FontSize="12"
Title="朝夕运动视觉框架" Height="750" Width="1300"> Title="运动视觉框架" Height="750" Width="1300">
<WindowChrome.WindowChrome> <WindowChrome.WindowChrome>
<WindowChrome NonClientFrameEdges="None" UseAeroCaptionButtons="False"/> <WindowChrome NonClientFrameEdges="None" UseAeroCaptionButtons="False"/>
</WindowChrome.WindowChrome> </WindowChrome.WindowChrome>
@@ -151,9 +151,11 @@
<TextBlock Text="&lt;未登录&gt;" VerticalAlignment="Center" Margin="3,0"/> <TextBlock Text="&lt;未登录&gt;" VerticalAlignment="Center" Margin="3,0"/>
<Border Height="16" Width="1" Background="#CCC" Margin="5,0"/> <Border Height="16" Width="1" Background="#CCC" Margin="5,0"/>
<Button Content="&#xe65a;" Style="{StaticResource TitleButtonStyle}" <Button Content="&#xe65a;" Style="{StaticResource TitleButtonStyle}"
FontSize="14" Margin="0"/> FontSize="14" Margin="0"
Command="{Binding MinimizeCommand}"/>
<Button Content="&#xe692;" Style="{StaticResource TitleButtonStyle}" <Button Content="&#xe692;" Style="{StaticResource TitleButtonStyle}"
FontSize="14" Margin="0"/> FontSize="14" Margin="0"
Command="{Binding MaximizeCommand}"/>
<Button Content="&#xe660;" Style="{StaticResource TitleButtonStyle}" <Button Content="&#xe660;" Style="{StaticResource TitleButtonStyle}"
FontSize="14" Margin="0,0,5,0" FontSize="14" Margin="0,0,5,0"
Click="Button_Click"/> Click="Button_Click"/>