public void ThorwsInLayoutChildrenWithNullFlyout() { var page = new FlyoutPage { Detail = new ContentPage { Content = new View(), IsPlatformEnabled = true }, IsPlatformEnabled = true, }; Assert.Throws <InvalidOperationException>(() => page.Layout(new Rectangle(0, 0, 200, 200))); }
public void TestLayoutChildren() { var page = new FlyoutPage { Flyout = new ContentPage { Content = new View(), IsPlatformEnabled = true, Title = "Foo" }, Detail = new ContentPage { Content = new View(), IsPlatformEnabled = true }, IsPlatformEnabled = true, }; ((IFlyoutPageController)page).FlyoutBounds = new Rectangle(0, 0, 100, 200); ((IFlyoutPageController)page).DetailBounds = new Rectangle(0, 0, 100, 100); page.Flyout.Layout(new Rectangle(0, 0, 1, 1)); page.Detail.Layout(new Rectangle(0, 0, 1, 1)); page.Layout(new Rectangle(0, 0, 200, 200)); Assert.AreEqual(new Rectangle(0, 0, 100, 200), page.Flyout.Bounds); Assert.AreEqual(new Rectangle(0, 0, 100, 100), page.Detail.Bounds); }