This document contains guidelines to adhere to, when contributing code to this repository. For reporting bugs, making suggestions, etc., please submit an issue.
During participation / contribution, make sure to act according to code of conduct located here.
- Visual Studio with the Universal Windows Platform development tools.
- (Recommended) File Nesting extension for Visual Studio.
- (Recommended) XAML Styler extension for Visual Studio.
New types of notifications (whose use-cases are not too specific) are always welcome to be included in this library. However, please ensure that the following conditions are met,
-
The notification is created according to the creation guide.
-
The class representing the notification should,
-
Be a member of the
RavinduL.LocalNotifications.Notifications
namespace. -
Be separated into multiple files according to the following criteria,
File Contents NotificationName.cs
Code that contains the logic of the notification. NotificationName.Properties.cs
Dependency properties with their corresponding static
fields.NotificationName.Constants.cs
Notification-level constants (e.g. names of expected template elements). -
The main file (
NotificationName.cs
) should declare the class aspublic partial NotificationName
, while the others should add to it by referring to it aspartial class NotificationName
. -
If possible, the File Nesting extension should be used to nest the other files dependent under main file within Solution Explorer (right click → File Nesting → Nest Item...),
-
-
Should have the
TemplatePart
andTemplateVisualState
attributes containing the names of the expected template elements and visual states, if any. -
Have characteristic public members documented using correctly formatted XML documentation comments.
-
Handle changes in values of dependency properties by a method in the main class, like so,
public ... Some { get { return (...)GetValue(SomeProperty); } set { SetValue(SomeProperty, value); } } public static readonly DependencyProperty SomeProperty = DependencyProperty.Register(nameof(Some), typeof(...), typeof(NotificationName), new PropertyMetadata(null, (d, e) => ((NotificationName)d).OnSomeChanged()));
wherein the
OnSomeChanged
method is declared inNotificationName.cs
, and doesn't need to be parameterless.
-
-
The XAML resource dictionary containing the default style and template of the notification is named after the notification (i.e.
NotificationName.xaml
), and should be merged into the resource dictionary atsrc/RavinduL.LocalNotifications/Themes/Generic.xaml
as,<ResourceDictionary Source="ms-appx:///RavinduL.LocalNotifications/Notifications/NotificationName/NotificationName.xaml" />
-
If possible, the XAML is consistently formatted by the XAML Styler extension.
-
All files related to the notification are located within subdirectory of the
src/RavinduL.LocalNotifications/Notifications
folder, named the same as the notification, making the following directory structure,src/RavinduL.LocalNotifications/Notifications/ ├─ NotificationName/ │ ├─ NotificationName.cs │ ├─ NotificationName.Properties.cs │ ├─ NotificationName.Constants.cs │ └─ NotificationName.xaml