Skip to content

Commit 6c95dfd

Browse files
committed
BrowserWindow: Add OnBoundsChanged event
While not being an original Electron event, this one includes the bounds values, saving the additional roundtrip for calling GetBoundsAsync
1 parent 682a1c3 commit 6c95dfd

File tree

4 files changed

+27
-1
lines changed

4 files changed

+27
-1
lines changed

src/ElectronNET.API/API/BrowserWindow.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,19 @@ public event Action OnMove
186186
remove => RemoveEvent(value, Id);
187187
}
188188

189+
/// <summary>
190+
/// Emitted when the window is moved or resized.
191+
/// </summary>
192+
/// <remarks>
193+
/// While not being an original Electron event, this one includes the bounds values,
194+
/// saving the additional roundtrip for calling <see cref="GetBoundsAsync"/>.
195+
/// </remarks>
196+
public event Action<Rectangle> OnBoundsChanged
197+
{
198+
add => AddEvent(value, Id);
199+
remove => RemoveEvent(value, Id);
200+
}
201+
189202
/// <summary>
190203
/// macOS: Emitted once when the window is moved to a new position.
191204
/// </summary>

src/ElectronNET.Host/api/browserWindows.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)