Explorar o código

Added AreaChanged event to ZoomPanel

Kenric Nugteren hai 5 meses
pai
achega
c020888568
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      inabox.wpf/Forms/ZoomPanel/ZoomPanel.xaml.cs

+ 7 - 0
inabox.wpf/Forms/ZoomPanel/ZoomPanel.xaml.cs

@@ -24,6 +24,10 @@ namespace InABox.WPF;
 /// </summary>
 public partial class ZoomPanel : ContentControl, INotifyPropertyChanged
 {
+    public delegate void AreaChangedHandler(ZoomPanel panel);
+
+    public event AreaChangedHandler? AreaChanged;
+
     private bool _showNavigationButtons = false;
     public bool ShowNavigationButtons
     {
@@ -58,6 +62,7 @@ public partial class ZoomPanel : ContentControl, INotifyPropertyChanged
         {
             _scale = value;
             OnPropertyChanged();
+            AreaChanged?.Invoke(this);
         }
     }
 
@@ -70,6 +75,7 @@ public partial class ZoomPanel : ContentControl, INotifyPropertyChanged
         set
         {
             Scroll.ScrollToHorizontalOffset(value);
+            AreaChanged?.Invoke(this);
         }
     }
 
@@ -79,6 +85,7 @@ public partial class ZoomPanel : ContentControl, INotifyPropertyChanged
         set
         {
             Scroll.ScrollToVerticalOffset(value);
+            AreaChanged?.Invoke(this);
         }
     }