pkar.UWP.Triggers 1.2.0

Prefix Reserved
dotnet add package pkar.UWP.Triggers --version 1.2.0
                    
NuGet\Install-Package pkar.UWP.Triggers -Version 1.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="pkar.UWP.Triggers" Version="1.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="pkar.UWP.Triggers" Version="1.2.0" />
                    
Directory.Packages.props
<PackageReference Include="pkar.UWP.Triggers" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add pkar.UWP.Triggers --version 1.2.0
                    
#r "nuget: pkar.UWP.Triggers, 1.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package pkar.UWP.Triggers@1.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=pkar.UWP.Triggers&version=1.2.0
                    
Install as a Cake Addin
#tool nuget:?package=pkar.UWP.Triggers&version=1.2.0
                    
Install as a Cake Tool

This Nuget contains wrappers for UWP Triggers.

Function IsTriggersRegistered() As Boolean
Function IsTriggersRegistered(nameFragment As String) As Boolean
Async Function CanRegisterTriggersAsync() As Task(Of Boolean)

Sub UnregisterTriggers()
Sub UnregisterTriggers(nameFragment As String)

Function RegisterTimerTrigger(name As String, freshnessMinutes As Integer, Optional oneShot As Boolean = False, Optional condition As Background.SystemCondition = Nothing) As BackgroundTaskRegistration
Function RegisterUserPresentTrigger(Optional Name As String = "", Optional oneShot As Boolean = False) As BackgroundTaskRegistration
Function RegisterServicingCompletedTrigger(Optional Name As String = "") As BackgroundTaskRegistration
Function RegisterToastTrigger(Optional Name As String = ") As BackgroundTaskRegistration

Function RegisterMidnightTrigger() As BackgroundTaskRegistration
Function IsThisMidnightTrigger(args As BackgroundActivatedEventArgs) As Boolean

Function DumpTriggers() As String
Function GetLastMidnightTriggerDate() As Date

Since 1.2.0, package contains one UserControl: AppBarClockTriggerToggleButton, that is AppBarToggleButton with:

    AppBarClockTriggerToggleButton.Icon=SymbolIcon(Symbol.Clock)
    AppBarClockTriggerToggleButton.Label="Autorun"
    AppBarClockTriggerToggleButton.RunEveryMin=30
    AppBarClockTriggerToggleButton.RunEveryHr=0.5
    AppBarClockTriggerToggleButton.RunPolnoc=false ' be warned! you should call IsThisMidnightTrigger from timer code
    AppBarClockTriggerToggleButton.TriggerName= Package.Current.DisplayName & "_Timer"
    AppBarClockTriggerToggleButton.DefaultState=false
    AppBarClockTriggerToggleButton.AutoUnregister=false' If TRUE, unchecking AppBarToggleButton would cause unregistering timer
    Event AppBarClockTriggerToggleButton.OnClick(sender As Object, RoutedEventArgs As Object)
    

Simply add this AppBarClockTriggerToggleButton to your XAML page. Its state (.IsChecked) would reflect IsTriggerRegistered - checking would register trigger, and unregistering can unregister (see AutoUnregister). Check/uncheck can also raise event OnClick (AFTER registering/unregistering)

Product Compatible and additional computed target framework versions.
Universal Windows Platform netcore50 is compatible.  uap was computed.  uap10.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.2.0 231 8/5/2025
1.0.1 242 10/13/2023
1.0.0 237 10/13/2023 1.0.0 is deprecated.

changed namespace