forked from kas/percentage
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed a bug that can allow multiple instances to run in the backgroun…
…d, and added buttons to toast notifications.
- Loading branch information
1 parent
40024a1
commit 17daacd
Showing
7 changed files
with
107 additions
and
49 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
using Microsoft.Toolkit.Uwp.Notifications; | ||
|
||
namespace Percentage.App.Extensions; | ||
|
||
internal static class ToastNotificationExtensions | ||
{ | ||
private const string ActionArgumentKey = "action"; | ||
|
||
internal static Action GetActionArgument(this ToastArguments arguments) | ||
{ | ||
return arguments.GetEnum<Action>(ActionArgumentKey); | ||
} | ||
|
||
internal static void ShowToastNotification(string header, string body) | ||
{ | ||
new ToastContentBuilder() | ||
.AddText(header) | ||
.AddText(body) | ||
.AddButton(new ToastButton().SetContent("See more details") | ||
.AddArgument(ActionArgumentKey, Action.ViewDetails)) | ||
.AddButton(new ToastButtonDismiss()) | ||
.Show(); | ||
} | ||
|
||
internal enum Action | ||
{ | ||
ViewDetails = 0 | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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