// ----------------------------------------------------------------------- // // Copyright 2014 MIT Licence. See licence.md for more information. // // ----------------------------------------------------------------------- namespace Perspex.Controls { using Perspex.Interactivity; using Perspex.Media; using Perspex.Platform; using Splat; public class PopupRoot : TopLevel, IInteractive { static PopupRoot() { BackgroundProperty.OverrideDefaultValue(typeof(PopupRoot), Brushes.White); } public PopupRoot() : base(Locator.Current.GetService()) { } public new IPopupImpl PlatformImpl { get { return (IPopupImpl)base.PlatformImpl; } } IInteractive IInteractive.InteractiveParent { get { return this.Parent; } } public void SetPosition(Point p) { this.PlatformImpl.SetPosition(p); } public void Hide() { this.PlatformImpl.Hide(); this.IsVisible = false; } public void Show() { this.PlatformImpl.Show(); this.LayoutManager.ExecuteLayoutPass(); this.IsVisible = true; } } }