mirror of https://github.com/AMT-Cheif/Stylet.git
Don't instantiate a Lazy<IWeakEventManager> in Screen, since we don't need to
This commit is contained in:
parent
48e7de53a6
commit
30472cffca
|
@ -21,11 +21,19 @@ namespace Stylet
|
||||||
|
|
||||||
#region WeakEventManager
|
#region WeakEventManager
|
||||||
|
|
||||||
private Lazy<IWeakEventManager> lazyWeakEventManager = new Lazy<IWeakEventManager>(() => new WeakEventManager(), true);
|
private IWeakEventManager _weakEventManager;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// WeakEventManager owned by this screen (lazy)
|
/// WeakEventManager owned by this screen (lazy)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected IWeakEventManager weakEventManager { get { return this.lazyWeakEventManager.Value; } }
|
protected IWeakEventManager weakEventManager
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
if (this._weakEventManager == null)
|
||||||
|
this._weakEventManager = new WeakEventManager();
|
||||||
|
return this._weakEventManager;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Proxy around this.weakEventManager.BindWeak. Binds to an INotifyPropertyChanged source, in a way which doesn't cause us to be retained
|
/// Proxy around this.weakEventManager.BindWeak. Binds to an INotifyPropertyChanged source, in a way which doesn't cause us to be retained
|
||||||
|
|
Loading…
Reference in New Issue