using System; using System.Collections; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Reactive.Subjects; using System.Threading; using Avalonia.Controls; using Avalonia.Data.Converters; using Avalonia.UnitTests; using Xunit; namespace Avalonia.Markup.Xaml.UnitTests.Xaml { public class RelativePanelTests : XamlTestBase { [Fact] public void ScrollViewer_Viewport_Small_Than_Bounds() { using (UnitTestApplication.Start(TestServices.StyledWindow)) { var xaml = @" "; var window = (Window)AvaloniaRuntimeXamlLoader.Load(xaml); { var panel = window.GetControl("TestRelativePanel"); panel.DataContext = new { DataExample = Enumerable.Range(1001, 100).Select(e => new { Id = $"{e}" }) }; } window.ApplyTemplate(); window.Show(); var sv = window.GetControl("TestArea"); Assert.True(sv.Viewport.Width < sv.Bounds.Width); Assert.True(sv.Viewport.Height < sv.Bounds.Height); } } } }