WinSpaceBottom.xaml.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace SpacePlugin
  15. {
  16. /// <summary>
  17. /// WinSpaceBottom.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class WinSpaceBottom : Window
  20. {
  21. public WinSpaceBottom()
  22. {
  23. InitializeComponent();
  24. }
  25. private void slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
  26. {
  27. scalTrans.ScaleX = this.slider.Value;
  28. scalTrans.ScaleY = this.slider.Value;
  29. }
  30. private void Canvas_OnMouseWheel(object sender, MouseWheelEventArgs e)
  31. {
  32. int delta = e.Delta;
  33. double sliderValue = this.slider.Value;
  34. double seed= this.slider.LargeChange;
  35. if (delta > 0)
  36. {
  37. //下滚
  38. sliderValue -= seed;
  39. }
  40. else
  41. {
  42. //上滚
  43. sliderValue += seed;
  44. }
  45. this.slider.Value=sliderValue;
  46. }
  47. }
  48. }