diff --git a/src/Avalonia.Xaml.Interactions.Responsive/AdaptiveBehavior.cs b/src/Avalonia.Xaml.Interactions.Responsive/AdaptiveBehavior.cs index a8fabeb0..5e2612b4 100644 --- a/src/Avalonia.Xaml.Interactions.Responsive/AdaptiveBehavior.cs +++ b/src/Avalonia.Xaml.Interactions.Responsive/AdaptiveBehavior.cs @@ -100,11 +100,16 @@ private IDisposable ObserveBounds(Control sourceControl) throw new ArgumentNullException(nameof(sourceControl)); } + Execute(sourceControl, Setters, sourceControl.GetValue(Visual.BoundsProperty)); + return sourceControl.GetObservable(Visual.BoundsProperty) - .Subscribe(new AnonymousObserver(bounds => ValueChanged(sourceControl, Setters, bounds))); + .Subscribe(new AnonymousObserver(bounds => + { + Execute(sourceControl, Setters, bounds); + })); } - private void ValueChanged(Control? sourceControl, AvaloniaList? setters, Rect bounds) + private void Execute(Control? sourceControl, AvaloniaList? setters, Rect bounds) { if (sourceControl is null || setters is null) {