/// <summary>
 /// Windowを作成する
 /// </summary>
 private void CreateWindow()
 {
     if (this.WindowFactory != null)
     {
         this.IsWindowCreated = true;
         this.WindowState     = eWindowStateTypes.Initializeing;
         this.WindowFactory.Create();
     }
     else
     {
         throw new InvalidOperationException($"{nameof( this.WindowFactory )}が指定されていません");
     }
 }
        /// <summary>
        /// Windowの可視状態を変更する
        /// </summary>
        /// <param name="hide"><see langword="true"/>=不可視, <see langword="false"/>=可視</param>
        private void WindowHideControl(bool hide)
        {
            if (this.WindowController == null)
            {
                throw new InvalidOperationException($"{nameof( this.WindowController )}が指定されていません");
            }

            if (this.WindowState == eWindowStateTypes.Initializeing)
            {
                throw new InvalidOperationException($"Window初期化中は操作できません");
            }

            this.WindowController.Opacity = hide ? 0.0 : 1.0;
            this.WindowState = hide ? eWindowStateTypes.Hide : eWindowStateTypes.Shown;
        }
        protected virtual void OnWindowControllerChanged(EventArgs <IWindowController> eventArgs)
        {
            this.WindowControllerChanged?.Invoke(eventArgs);

            if (eventArgs.OldValue != null)
            {
                this.ObservableWindowInitialized?.Dispose();
                this.ObservableWindowInitialized = null;

                this.ObservableWindowClosed?.Dispose();
                this.ObservableWindowClosed = null;

                this.ObservableHiddenChanged?.Dispose();
                this.ObservableHiddenChanged = null;

                this.IsWindowCreated = false;
                this.WindowState     = eWindowStateTypes.Closed;
            }

            if (eventArgs.NewValue != null)
            {
                this.ObservableWindowInitialized = Observable.FromEventPattern
                                                   (
                    handler => eventArgs.NewValue.Initialized += handler,
                    handler => eventArgs.NewValue.Initialized -= handler
                                                   )
                                                   .Subscribe(_ => { this.WindowState = eWindowStateTypes.Shown; });

                this.ObservableWindowClosed = Observable.FromEventPattern
                                              (
                    handler => eventArgs.NewValue.Closed += handler,
                    handler => eventArgs.NewValue.Closed -= handler
                                              )
                                              .Subscribe(_ =>
                {
                    this.WindowState      = eWindowStateTypes.Closed;
                    this.WindowController = default(TController);
                });
            }
        }
 /// <summary>
 /// Windowを閉じる
 /// </summary>
 protected virtual void Close()
 {
     this.WindowController?.Close();
     this.WindowState = eWindowStateTypes.Closed;
 }
 protected virtual void OnWindowStateChanged(eWindowStateTypes windowState)
 {
     this.WindowStateChanged?.Invoke(windowState);
 }