mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-20 11:44:59 +00:00
parent
85b223a3d0
commit
e4490d87dc
1 changed files with 12 additions and 9 deletions
|
@ -107,18 +107,24 @@ namespace SourceGit
|
||||||
#region Utility Functions
|
#region Utility Functions
|
||||||
public static void ShowWindow(object data, bool showAsDialog)
|
public static void ShowWindow(object data, bool showAsDialog)
|
||||||
{
|
{
|
||||||
if (data is Views.ChromelessWindow window)
|
var impl = (Views.ChromelessWindow target, bool isDialog) =>
|
||||||
{
|
{
|
||||||
if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
|
if (Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
|
||||||
{
|
{
|
||||||
if (showAsDialog)
|
if (isDialog)
|
||||||
window.ShowDialog(owner);
|
target.ShowDialog(owner);
|
||||||
else
|
else
|
||||||
window.Show(owner);
|
target.Show(owner);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
window.Show();
|
{
|
||||||
|
target.Show();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
if (data is Views.ChromelessWindow window)
|
||||||
|
{
|
||||||
|
impl(window, showAsDialog);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -135,10 +141,7 @@ namespace SourceGit
|
||||||
if (window != null)
|
if (window != null)
|
||||||
{
|
{
|
||||||
window.DataContext = data;
|
window.DataContext = data;
|
||||||
if (showAsDialog && Current?.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime { MainWindow: { } owner })
|
impl(window, showAsDialog);
|
||||||
window.ShowDialog(owner);
|
|
||||||
else
|
|
||||||
window.Show();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue