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)
107
107
#region Utility Functions
108
108
public static void ShowWindow ( object data , bool showAsDialog )
109
109
{
110
- if ( data is Views . ChromelessWindow window )
110
+ var impl = ( Views . ChromelessWindow target , bool isDialog ) =>
111
111
{
112
112
if ( Current ? . ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow : { } owner } )
113
113
{
114
- if ( showAsDialog )
115
- window . ShowDialog ( owner ) ;
114
+ if ( isDialog )
115
+ target . ShowDialog ( owner ) ;
116
116
else
117
- window . Show ( owner ) ;
117
+ target . Show ( owner ) ;
118
118
}
119
119
else
120
- window . Show ( ) ;
120
+ {
121
+ target . Show ( ) ;
122
+ }
123
+ } ;
121
124
125
+ if ( data is Views . ChromelessWindow window )
126
+ {
127
+ impl ( window , showAsDialog ) ;
122
128
return ;
123
129
}
124
130
@@ -135,10 +141,7 @@ public static void ShowWindow(object data, bool showAsDialog)
135
141
if ( window != null )
136
142
{
137
143
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 ) ;
142
145
}
143
146
}
144
147
You can’t perform that action at this time.
0 commit comments