/// <summary> /// Instantiates class of type DialogSignalerEnvironment. /// </summary> /// <param name="dialogController">DialogSignaler object or ViewModel whose state is to be contained.</param> /// <param name="dialog">DialogSignaler or ViewModel's window.</param> public DialogSignalerEnvironment(IDialogSignaler <TEventArgs> dialogController, Window dialog) { Dialog = dialog; Dialog.Closed += OnDialogClosed; DialogController = dialogController; DialogController.Cancelled += OnCancelled; DialogController.Successful += OnSuccessful; }
private bool disposedValue = false; // To detect redundant calls protected virtual void Dispose(bool disposing) { if (!disposedValue) { if (disposing) { Dialog.Closed -= OnDialogClosed; DialogController.Cancelled -= OnCancelled; DialogController.Successful -= OnSuccessful; Dialog = null; DialogController = null; DialogClosed = null; Cancelled = null; Successful = null; } // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. // TODO: set large fields to null. disposedValue = true; } }