mirror of
https://gitee.com/wang-yin1/wpf-visual-process-framework
synced 2026-03-02 15:50:51 +08:00
2025-07-15 15:16
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
WindowStartupLocation="CenterScreen"
|
||||
FontWeight="ExtraLight"
|
||||
FontSize="12"
|
||||
Title="朝夕运动视觉框架" Height="750" Width="1300">
|
||||
Title="运动视觉框架" Height="750" Width="1300">
|
||||
<WindowChrome.WindowChrome>
|
||||
<WindowChrome NonClientFrameEdges="None" UseAeroCaptionButtons="False"/>
|
||||
</WindowChrome.WindowChrome>
|
||||
@@ -151,9 +151,11 @@
|
||||
<TextBlock Text="<未登录>" VerticalAlignment="Center" Margin="3,0"/>
|
||||
<Border Height="16" Width="1" Background="#CCC" Margin="5,0"/>
|
||||
<Button Content="" Style="{StaticResource TitleButtonStyle}"
|
||||
FontSize="14" Margin="0"/>
|
||||
FontSize="14" Margin="0"
|
||||
Command="{Binding MinimizeCommand}"/>
|
||||
<Button Content="" Style="{StaticResource TitleButtonStyle}"
|
||||
FontSize="14" Margin="0"/>
|
||||
FontSize="14" Margin="0"
|
||||
Command="{Binding MaximizeCommand}"/>
|
||||
<Button Content="" Style="{StaticResource TitleButtonStyle}"
|
||||
FontSize="14" Margin="0,0,5,0"
|
||||
Click="Button_Click"/>
|
||||
|
||||
Reference in New Issue
Block a user