ReDo Undo Item ItemWidth 和 Angle 等工具栏设置完成

This commit is contained in:
艾竹
2023-04-09 12:38:57 +08:00
parent 2ef5b7a1ed
commit fae7826577
16 changed files with 487 additions and 464 deletions

View File

@@ -31,8 +31,6 @@ namespace AIStudio.Wpf.DiagramApp
{
InitializeComponent();
this.HookEvents();
MainWindowViewModel = new MainWindowViewModel();
this.DataContext = MainWindowViewModel;
this.Closing += MainWindow_Closing;
@@ -44,32 +42,12 @@ namespace AIStudio.Wpf.DiagramApp
e.Handled = MainWindowViewModel.KeyExecuted(e);
}
private void HookEvents()
{
//this.PreviewMouseWheel += this.OnPreviewMouseWheel;
}
private void ZoomSlider_OnValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
var textFormattingMode = e.NewValue > 1.0 || Math.Abs(e.NewValue - 1.0) < double.Epsilon ? TextFormattingMode.Ideal : TextFormattingMode.Display;
TextOptions.SetTextFormattingMode(this, textFormattingMode);
}
//private void OnPreviewMouseWheel(object sender, MouseWheelEventArgs e)
//{
// if (Keyboard.IsKeyDown(Key.LeftCtrl) == false
// && Keyboard.IsKeyDown(Key.RightCtrl) == false)
// {
// return;
// }
// var newZoomValue = this.zoomSlider.Value + (e.Delta > 0 ? 0.1 : -0.1);
// this.zoomSlider.Value = Math.Max(Math.Min(newZoomValue, this.zoomSlider.Maximum), this.zoomSlider.Minimum);
// e.Handled = true;
//}
private void btnPrint_Click(object sender, RoutedEventArgs e)
{
PrintDialog printDialog = new PrintDialog();