From fa96573cbd62ec830a73f72ff9c64f8041a74799 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=89=BE=E7=AB=B9?= Date: Sat, 8 Apr 2023 18:08:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ViewModels/MainWindowViewModel.cs | 296 +----------------- AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml | 57 ++-- 2 files changed, 32 insertions(+), 321 deletions(-) diff --git a/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs b/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs index 8a6404d..2cbf1fc 100644 --- a/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs +++ b/AIStudio.Wpf.DiagramApp/ViewModels/MainWindowViewModel.cs @@ -340,187 +340,7 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels { return this._deleteCommand ?? (this._deleteCommand = new CanExecuteDelegateCommand(() => this.DeleteExecuted(), () => Delete_Enabled())); } - } - - private ICommand _alignTopCommand; - public ICommand AlignTopCommand - { - get - { - return this._alignTopCommand ?? (this._alignTopCommand = new DelegateCommand(para => this.AlignTopExecuted(para))); - } - } - - private ICommand _alignVerticalCentersCommand; - public ICommand AlignVerticalCentersCommand - { - get - { - return this._alignVerticalCentersCommand ?? (this._alignVerticalCentersCommand = new DelegateCommand(para => this.AlignVerticalCentersExecuted(para))); - } - } - - private ICommand _alignBottomCommand; - public ICommand AlignBottomCommand - { - get - { - return this._alignBottomCommand ?? (this._alignBottomCommand = new DelegateCommand(para => this.AlignBottomExecuted(para))); - } - } - - private ICommand _alignLeftCommand; - public ICommand AlignLeftCommand - { - get - { - return this._alignLeftCommand ?? (this._alignLeftCommand = new DelegateCommand(para => this.AlignLeftExecuted(para))); - } - } - - private ICommand _alignHorizontalCentersCommand; - public ICommand AlignHorizontalCentersCommand - { - get - { - return this._alignHorizontalCentersCommand ?? (this._alignHorizontalCentersCommand = new DelegateCommand(para => this.AlignHorizontalCentersExecuted(para))); - } - } - - private ICommand _alignRightCommand; - public ICommand AlignRightCommand - { - get - { - return this._alignRightCommand ?? (this._alignRightCommand = new DelegateCommand(para => this.AlignRightExecuted(para))); - } - } - - private ICommand _groupCommand; - public ICommand GroupCommand - { - get - { - return this._groupCommand ?? (this._groupCommand = new DelegateCommand(para => this.GroupExecuted(para))); - } - } - - private ICommand _ungroupCommand; - public ICommand UngroupCommand - { - get - { - return this._ungroupCommand ?? (this._ungroupCommand = new DelegateCommand(para => this.UngroupExecuted(para))); - } - } - - private ICommand _bringForwardCommand; - public ICommand BringForwardCommand - { - get - { - return this._bringForwardCommand ?? (this._bringForwardCommand = new DelegateCommand(para => this.BringForwardExecuted(para))); - } - } - - private ICommand _bringToFrontCommand; - public ICommand BringToFrontCommand - { - get - { - return this._bringToFrontCommand ?? (this._bringToFrontCommand = new DelegateCommand(para => this.BringToFrontExecuted(para))); - } - } - - private ICommand _sendBackwardCommand; - public ICommand SendBackwardCommand - { - get - { - return this._sendBackwardCommand ?? (this._sendBackwardCommand = new DelegateCommand(para => this.SendBackwardExecuted(para))); - } - } - - private ICommand _sendToBackCommand; - public ICommand SendToBackCommand - { - get - { - return this._sendToBackCommand ?? (this._sendToBackCommand = new DelegateCommand(para => this.SendToBackExecuted(para))); - } - } - - private ICommand _distributeHorizontalCommand; - public ICommand DistributeHorizontalCommand - { - get - { - return this._distributeHorizontalCommand ?? (this._distributeHorizontalCommand = new DelegateCommand(para => this.DistributeHorizontalExecuted(para))); - } - } - - private ICommand _distributeVerticalCommand; - public ICommand DistributeVerticalCommand - { - get - { - return this._distributeVerticalCommand ?? (this._distributeVerticalCommand = new DelegateCommand(para => this.DistributeVerticalExecuted(para))); - } - } - - private ICommand _selectAllCommand; - public ICommand SelectAllCommand - { - get - { - return this._selectAllCommand ?? (this._selectAllCommand = new DelegateCommand(para => this.SelectAllExecuted(para))); - } - } - - private ICommand _centerCommand; - public ICommand CenterCommand - { - get - { - return this._centerCommand ?? (this._centerCommand = new DelegateCommand(para => this.CenterMoveExecuted(para))); - } - } - - private ICommand _sameWidthCommand; - public ICommand SameWidthCommand - { - get - { - return this._sameWidthCommand ?? (this._sameWidthCommand = new DelegateCommand(para => this.SameWidthExecuted(para))); - } - } - - private ICommand _sameHeightCommand; - public ICommand SameHeightCommand - { - get - { - return this._sameHeightCommand ?? (this._sameHeightCommand = new DelegateCommand(para => this.SameHeightExecuted(para))); - } - } - - private ICommand _sameSizeCommand; - public ICommand SameSizeCommand - { - get - { - return this._sameSizeCommand ?? (this._sameSizeCommand = new DelegateCommand(para => this.SameSizeExecuted(para))); - } - } - - private ICommand _sameAngleCommand; - public ICommand SameAngleCommand - { - get - { - return this._sameAngleCommand ?? (this._sameAngleCommand = new DelegateCommand(para => this.SameAngleExecuted(para))); - } - } + } private ICommand _lockCommand; public ICommand LockCommand @@ -956,118 +776,8 @@ namespace AIStudio.Wpf.DiagramApp.ViewModels private void ExitExecuted() { - throw new NotImplementedException(); - } - - private void GroupExecuted(object para) - { - PageViewModel?.DiagramViewModel?.GroupCommand.Execute(para); - } - - private void UngroupExecuted(object para) - { - PageViewModel?.DiagramViewModel?.UngroupCommand.Execute(para); - } - - #region 布局 - private void AlignTopExecuted(object para) - { - PageViewModel?.DiagramViewModel?.AlignTopCommand.Execute(para); - } - private void AlignVerticalCentersExecuted(object para) - { - PageViewModel?.DiagramViewModel?.AlignVerticalCentersCommand.Execute(para); - } - private void AlignBottomExecuted(object para) - { - PageViewModel?.DiagramViewModel?.AlignBottomCommand.Execute(para); - } - private void AlignLeftExecuted(object para) - { - PageViewModel?.DiagramViewModel?.AlignLeftCommand.Execute(para); - } - private void AlignHorizontalCentersExecuted(object para) - { - PageViewModel?.DiagramViewModel?.AlignHorizontalCentersCommand.Execute(para); - } - private void AlignRightExecuted(object para) - { - PageViewModel?.DiagramViewModel?.AlignRightCommand.Execute(para); - } - private void BringForwardExecuted(object para) - { - PageViewModel?.DiagramViewModel?.BringForwardCommand.Execute(para); - } - private void BringToFrontExecuted(object para) - { - PageViewModel?.DiagramViewModel?.BringToFrontCommand.Execute(para); - } - private void SendBackwardExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SendBackwardCommand.Execute(para); - } - private void SendToBackExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SendBackwardCommand.Execute(para); - } - private void DistributeHorizontalExecuted(object para) - { - PageViewModel?.DiagramViewModel?.DistributeHorizontalCommand.Execute(para); - } - private void DistributeVerticalExecuted(object para) - { - PageViewModel?.DiagramViewModel?.DistributeVerticalCommand.Execute(para); - } - private void SelectAllExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SelectAllCommand.Execute(para); - } - #endregion - - private void CenterMoveExecuted(object para) - { - PageViewModel?.DiagramViewModel?.CenterMoveCommand.Execute(para); - } - - private void LeftMoveExecuted(object para = null) - { - PageViewModel?.DiagramViewModel?.LeftMoveCommand.Execute(para); - } - - private void RightMoveExecuted(object para = null) - { - PageViewModel?.DiagramViewModel?.RightMoveCommand.Execute(para); - } - - private void UpMoveExecuted(object para = null) - { - PageViewModel?.DiagramViewModel?.UpMoveCommand.Execute(para); - } - - private void DownMoveExecuted(object para = null) - { - PageViewModel?.DiagramViewModel?.DownMoveCommand.Execute(para); - } - - private void SameWidthExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SameWidthCommand.Execute(para); - } - - private void SameHeightExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SameHeightCommand.Execute(para); - } - - private void SameSizeExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SameSizeCommand.Execute(para); - } - - private void SameAngleExecuted(object para) - { - PageViewModel?.DiagramViewModel?.SameAngleCommand.Execute(para); - } + + } private void LockExecuted(object para) { diff --git a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml index 493a9a7..e196eb0 100644 --- a/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml +++ b/AIStudio.Wpf.DiagramApp/Views/MainWindow.xaml @@ -827,6 +827,7 @@ +