Catel.MVVM.Providers.WindowLogic.InvokeCloseDynamically C# (CSharp) Method

InvokeCloseDynamically() private method

Invokes the close method on the window dynamically.
private InvokeCloseDynamically ( ) : void
return void
        private void InvokeCloseDynamically()
        {
            var closeMethod = TargetWindow.GetType().GetMethodEx("Close");
            if (closeMethod == null)
            {
                throw Log.ErrorAndCreateException<NotSupportedException>("Cannot close any window without a public 'Close()' method, implement the 'Close()' method on '{0}'", TargetWindow.GetType().Name);
            }

            closeMethod.Invoke(TargetWindow, null);
        }
        #endregion