Example #1
0
        /// <summary>Shows a window.</summary>
        /// <typeparam name="T">The window type.</typeparam>
        /// <returns>The result of <see cref="M:IWindow.ShowDialog()" />.</returns>
        protected bool?ShowWindow <T>()
            where T : IWindow
        {
            ShowWindowEvent showWindowEvent = new ShowWindowEvent
            {
                IWindow = IoC.Resolve <T>(),
            };

            var handler = ShowDialogWindow;

            if (handler != null)
            {
                handler(this, new DataEventArgs <ShowWindowEvent>(showWindowEvent));
            }
            else
            {
                throw new Exception("'ShowDialogWindow' event is not subscribed to.");
            }

            return(showWindowEvent.Result);
        }
Example #2
0
 public void HandleOutputEvent(ShowWindowEvent showWindowEvent)
 {
     Application.Current.Dispatcher.Invoke(
         () => { showWindowEvent.windowToShow.Show(); });
 }