csharpc-sharpdotnetxamlavaloniauicross-platformcross-platform-xamlavaloniaguimulti-platformuser-interfacedotnetcore
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
54 lines
1.3 KiB
54 lines
1.3 KiB
// -----------------------------------------------------------------------
|
|
// <copyright file="PopupRoot.cs" company="Steven Kirk">
|
|
// Copyright 2014 MIT Licence. See licence.md for more information.
|
|
// </copyright>
|
|
// -----------------------------------------------------------------------
|
|
|
|
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<IPopupImpl>())
|
|
{
|
|
}
|
|
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
|