-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0449bcb
commit 4d77050
Showing
8 changed files
with
175 additions
and
173 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,23 @@ | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Controls; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Controls.Primitives; | ||
using Avalonia.Markup.Xaml; | ||
|
||
namespace UITests | ||
namespace Avalonia.Svg.Skia.UiTests; | ||
|
||
public partial class App : Application | ||
{ | ||
public partial class App : Application | ||
{ | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
public override void Initialize() | ||
{ | ||
AvaloniaXamlLoader.Load(this); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new Window(); | ||
} | ||
|
||
public override void OnFrameworkInitializationCompleted() | ||
{ | ||
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) | ||
{ | ||
desktop.MainWindow = new Window(); | ||
} | ||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} | ||
} | ||
base.OnFrameworkInitializationCompleted(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,39 @@ | ||
using System; | ||
using Avalonia; | ||
using Avalonia.Controls; | ||
using Avalonia.Controls.ApplicationLifetimes; | ||
using Avalonia.Threading; | ||
|
||
namespace UITests | ||
namespace Avalonia.Svg.Skia.UiTests; | ||
|
||
public static class AvaloniaApp | ||
{ | ||
public static class AvaloniaApp | ||
{ | ||
public static void Stop() | ||
{ | ||
var app = GetApp(); | ||
if (app is IDisposable disposable) | ||
{ | ||
Dispatcher.UIThread.Post(disposable.Dispose); | ||
} | ||
public static void Stop() | ||
{ | ||
var app = GetApp(); | ||
|
||
if (app is IDisposable disposable) | ||
{ | ||
Dispatcher.UIThread.Post(disposable.Dispose); | ||
} | ||
|
||
if (app != null) | ||
Dispatcher.UIThread.Post(() => app.Shutdown()); | ||
} | ||
if (app != null) | ||
{ | ||
Dispatcher.UIThread.Post(() => app.Shutdown()); | ||
} | ||
} | ||
|
||
public static Window? GetMainWindow() => GetApp()?.MainWindow; | ||
public static Window? GetMainWindow() | ||
{ | ||
return GetApp()?.MainWindow; | ||
} | ||
|
||
public static IClassicDesktopStyleApplicationLifetime? GetApp() => | ||
(IClassicDesktopStyleApplicationLifetime?)Application.Current?.ApplicationLifetime; | ||
private static IClassicDesktopStyleApplicationLifetime? GetApp() | ||
{ | ||
return (IClassicDesktopStyleApplicationLifetime?)Application.Current?.ApplicationLifetime; | ||
} | ||
|
||
public static AppBuilder BuildAvaloniaApp() => | ||
AppBuilder | ||
.Configure<App>() | ||
.UsePlatformDetect(); | ||
} | ||
public static AppBuilder BuildAvaloniaApp() => | ||
AppBuilder | ||
.Configure<App>() | ||
.UsePlatformDetect(); | ||
} |
Oops, something went wrong.