File tree Expand file tree Collapse file tree 1 file changed +12
-9
lines changed
Expand file tree Collapse file tree 1 file changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -107,18 +107,24 @@ public static void LogException(Exception ex)
107107 #region Utility Functions
108108 public static void ShowWindow ( object data , bool showAsDialog )
109109 {
110- if ( data is Views . ChromelessWindow window )
110+ var impl = ( Views . ChromelessWindow target , bool isDialog ) =>
111111 {
112112 if ( Current ? . ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow : { } owner } )
113113 {
114- if ( showAsDialog )
115- window . ShowDialog ( owner ) ;
114+ if ( isDialog )
115+ target . ShowDialog ( owner ) ;
116116 else
117- window . Show ( owner ) ;
117+ target . Show ( owner ) ;
118118 }
119119 else
120- window . Show ( ) ;
120+ {
121+ target . Show ( ) ;
122+ }
123+ } ;
121124
125+ if ( data is Views . ChromelessWindow window )
126+ {
127+ impl ( window , showAsDialog ) ;
122128 return ;
123129 }
124130
@@ -135,10 +141,7 @@ public static void ShowWindow(object data, bool showAsDialog)
135141 if ( window != null )
136142 {
137143 window . DataContext = data ;
138- if ( showAsDialog && Current ? . ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow : { } owner } )
139- window . ShowDialog ( owner ) ;
140- else
141- window . Show ( ) ;
144+ impl ( window , showAsDialog ) ;
142145 }
143146 }
144147
You can’t perform that action at this time.
0 commit comments