Browse Source
We need to delay bindings until everything is set up before everything works though.pull/464/head
8 changed files with 187 additions and 14 deletions
@ -0,0 +1,31 @@ |
|||
// Copyright (c) The Perspex Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
using System; |
|||
using OmniXaml; |
|||
|
|||
namespace Perspex.Markup.Xaml.Context |
|||
{ |
|||
public class PerspexLifeCycleListener : IInstanceLifeCycleListener |
|||
{ |
|||
public void OnAfterProperties(object instance) |
|||
{ |
|||
} |
|||
|
|||
public void OnAssociatedToParent(object instance) |
|||
{ |
|||
} |
|||
|
|||
public void OnBegin(object instance) |
|||
{ |
|||
var isi = instance as ISupportInitialize; |
|||
isi?.BeginInit(); |
|||
} |
|||
|
|||
public void OnEnd(object instance) |
|||
{ |
|||
var isi = instance as ISupportInitialize; |
|||
isi?.EndInit(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
// Copyright (c) The Perspex Project. All rights reserved.
|
|||
// Licensed under the MIT license. See licence.md file in the project root for full license information.
|
|||
|
|||
namespace Perspex |
|||
{ |
|||
/// <summary>
|
|||
/// Specifies that this object supports a simple, transacted notification for batch
|
|||
/// initialization.
|
|||
/// </summary>
|
|||
public interface ISupportInitialize |
|||
{ |
|||
/// <summary>
|
|||
/// Signals the object that initialization is starting.
|
|||
/// </summary>
|
|||
void BeginInit(); |
|||
|
|||
/// <summary>
|
|||
/// Signals the object that initialization is complete.
|
|||
/// </summary>
|
|||
void EndInit(); |
|||
} |
|||
} |
|||
Loading…
Reference in new issue