@ -48,26 +48,12 @@ namespace Avalonia.Controls
public static readonly StyledProperty < IInputElement > PointerOverElementProperty =
AvaloniaProperty . Register < TopLevel , IInputElement > ( nameof ( IInputRoot . PointerOverElement ) ) ;
/// <summary>
/// Defines the <see cref="LocalNotificationManager"/> property.
/// </summary>
public static readonly DirectProperty < TopLevel , NotificationArea > LocalNotificationManagerProperty =
AvaloniaProperty . RegisterDirect < TopLevel , NotificationArea > ( nameof ( LocalNotificationManager ) , o = > o . LocalNotificationManager , ( o , v ) = > o . LocalNotificationManager = v ) ;
/// <summary>
/// Defines the <see cref="SystemNotificationManager"/> property.
/// </summary>
public static readonly DirectProperty < TopLevel , INotificationManager > SystemNotificationManagerProperty =
AvaloniaProperty . RegisterDirect < TopLevel , INotificationManager > ( nameof ( SystemNotificationManager ) , o = > o . SystemNotificationManager , ( o , v ) = > o . SystemNotificationManager = v ) ;
private readonly IInputManager _ inputManager ;
private readonly IAccessKeyHandler _ accessKeyHandler ;
private readonly IKeyboardNavigationHandler _ keyboardNavigationHandler ;
private readonly IApplicationLifecycle _ applicationLifecycle ;
private readonly IPlatformRenderInterface _ renderInterface ;
private Size _ clientSize ;
private NotificationArea _l ocalNotificationManager ;
private INotificationManager _ systemNotificationManager ;
private ILayoutManager _l ayoutManager ;
/// <summary>
@ -104,8 +90,6 @@ namespace Avalonia.Controls
PlatformImpl = impl ;
LocalNotificationManager = new NotificationArea ( ) ;
dependencyResolver = dependencyResolver ? ? AvaloniaLocator . Current ;
var styler = TryGetService < IStyler > ( dependencyResolver ) ;
@ -115,13 +99,6 @@ namespace Avalonia.Controls
_ applicationLifecycle = TryGetService < IApplicationLifecycle > ( dependencyResolver ) ;
_ renderInterface = TryGetService < IPlatformRenderInterface > ( dependencyResolver ) ;
_ systemNotificationManager = TryGetService < INotificationManager > ( dependencyResolver ) ;
if ( _ systemNotificationManager = = null )
{
SystemNotificationManager = _l ocalNotificationManager ;
}
Renderer = impl . CreateRenderer ( this ) ;
if ( Renderer ! = null )
@ -181,25 +158,6 @@ namespace Avalonia.Controls
protected set { SetAndRaise ( ClientSizeProperty , ref _ clientSize , value ) ; }
}
/// <summary>
/// Gets or sets the Local (in window managed) notification manager.
/// </summary>
public NotificationArea LocalNotificationManager
{
get = > _l ocalNotificationManager ;
protected set = > SetAndRaise ( LocalNotificationManagerProperty , ref _l ocalNotificationManager , value ) ;
}
/// <summary>
/// Gets or sets the System (native os) notification manager. If the system doesnt natively support notifications then this property
/// will match the <see cref="LocalNotificationManager"/>.
/// </summary>
public INotificationManager SystemNotificationManager
{
get = > _ systemNotificationManager ;
protected set = > SetAndRaise ( SystemNotificationManagerProperty , ref _ systemNotificationManager , value ) ;
}
public ILayoutManager LayoutManager
{
get
@ -415,20 +373,5 @@ namespace Avalonia.Controls
{
( this as IInputRoot ) . MouseDevice . SceneInvalidated ( this , e . DirtyRect ) ;
}
protected override void OnTemplateApplied ( TemplateAppliedEventArgs e )
{
var adornerLayer = this . GetVisualDescendants ( )
. OfType < AdornerDecorator > ( )
. FirstOrDefault ( )
? . AdornerLayer ;
if ( adornerLayer ! = null )
{
adornerLayer . Children . Add ( LocalNotificationManager as IControl ) ;
}
base . OnTemplateApplied ( e ) ;
}
}
}