-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Application.Exit on GTK and WPF
- Loading branch information
1 parent
101f35a
commit 55bfe8a
Showing
7 changed files
with
79 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using Uno.UI.Xaml; | ||
using Windows.UI.Xaml; | ||
|
||
namespace Uno.UI.Runtime.Skia | ||
{ | ||
public class GtkApplicationExtension : IApplicationExtension | ||
{ | ||
private readonly Application _owner; | ||
|
||
public GtkApplicationExtension(Application owner) | ||
{ | ||
_owner = owner ?? throw new ArgumentNullException(nameof(owner)); | ||
} | ||
|
||
public bool CanExit => true; | ||
|
||
public void Exit() => Gtk.Application.Default.Quit(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System; | ||
using Uno.UI.Xaml; | ||
using Windows.UI.Xaml; | ||
|
||
namespace Uno.UI.Runtime.Skia.Wpf | ||
{ | ||
public class WpfApplicationExtension : IApplicationExtension | ||
{ | ||
private readonly Application _owner; | ||
|
||
public WpfApplicationExtension(Application owner) | ||
{ | ||
_owner = owner ?? throw new ArgumentNullException(nameof(owner)); | ||
} | ||
|
||
public bool CanExit => true; | ||
|
||
public void Exit() => System.Windows.Application.Current.Shutdown(); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Uno.UI.Xaml | ||
{ | ||
internal interface IApplicationExtension | ||
{ | ||
bool CanExit { get; } | ||
|
||
void Exit(); | ||
} | ||
} |