SaaToast

SaaToast is a Notification, Toast, Alert, MessageBox.... should I continue ;) ? I mean it is everything. Only your ability to redesign it, is the limit.

The below illustrations show three main ways SaaToast works by default. These are the designs I put by default. You can change and make it to your needs.

SaaToast has Visual Designer. This means you can design the toast visually in your visual studio.

SaaToast is made up of these parts:

1. Container 2. Body 3. Head 4. Close 5. Icon 6. Loader

see the illustration below:

1. Container (Toast)

This is the main frame of the toast.

1.1 Colors

BackColor and BackColor2 are the two colors that form the background color of the toast. They can be adjusted with BackColorAngle.

1.2 Size

AutoSize tells whether the toast will resize itself to fit its contents. If you turn this on then the Size is ignored. You can still adjust it with OffHeight and OffWidth.

MinSize tells the minimum size the toast will accept.

Size tells the height and the width of the toast.

OffHeight tells the extra height to be added to the height of the toast when AutoSize is on. Since when AutoSize is on, Size is ignored, you can use OffHeight to add some height to the toast.

OffWidth tells the extra width to be added to the width of the toast when AutoSize is on. Since when AutoSize is on, Size is ignored, you can use OffWidth to add some width to the toast.

Padding tells the distance between edges of the toast and its contents.

1.3 Positions

Position tells the predefined position of the toast. It can be TopRight, TopLeft, BottomRight, BottomLeft or Center of the Screen/Form. This will be the initial position of the toast where its offsets will be calculated from. I mean it will be the base position of the toast at which its X and Y will be recognized as 0.

Movable tells whether the toast is movable. If you turn on then the user can move the toast with the mouse.

OffSetX tells how far the toast will be moved from the edge of the screen/form. I think you have seen most of SaaUI controls OffSetX counts from left to right side but for the SaaToast it counts from the edge of the screen/form depending on the Position except when the toast Position property is set to Center. This time it counts from left to right. See the illustration below. Arrow points where OffSetX will move the toast depending on the Position.

OffSetY tells how far the toast will be moved from the edge of the screen/form. I think you have seen most of SaaUI controls OffSetY counts from top to bottom side but for the SaaToast it counts from the edge of the screen/form depending on the Position except when the toast Position property is set to Center. This time it counts from top to bottom. See the illustration below. Arrow points where OffSetY will move the toast depending on the Position.

1.3 Radius

Radius property tells the roundness of the edges. With this property you can change the shapes of the border edges. Radius has four properties: TopLeft, TopRight, BottomRight, BottomLeft.

1.4 Others

AutoClose tells if the toast will close itself when the loader ends (even if the loader is hidden).

ClosePreviousToast tells whether all other toasts owned by the current application is dismissed whenever a new toast is created by this toast instance.

2. Body

2.1 Colors

BodyBackColor tells the background color of the body.

BodyTextColor tells the forecolor of the body (Text).

2.2 Size

BodyPadding tells the distance between the body edges and its contents.

2.3 Text and Font

Text tells the text to be displayed in the body.

BodyTextFont tells font for the Text displayed in the body.

2.4 Others

ShowBody tells whether the body is shown.

3. Head

3.1 Colors

HeaderBackColor and headerBackColor2 are the two colors that form the background color of the toast Head. They can be adjusted with HeaderBackColorAngle.

TitleBackColor tells the background color for the title.

TitleTextColor tells the forecolor of the title.

3.2 Size

HeaderPadding tells the distance between the Header edges and its contents.

TitlePadding tells the distance between the title edges and its contents.

3.3 Text and Font

TitleText tells the text to be displayed in the title.

TitleTextFont tells font for the Text displayed in the title.

3.4 Others

ShowHeader tells whether the header is shown. If header is hidden then both title and close button is hidden too.

ShowTitle tells whether the title is shown.

4. Close

4.1 Colors

CloseBackColor tells the background color of the close button.

4.2 Images

CloseActiveImage tells the image of the close button when mouse pointer is over it.

CloseInActiveImage tells the image of the close button when mouse pointer leaves.

CloseImageSizeMode tells the sizing mode of CloseActiveImage and CloseInActiveImage.

4.3 Size

ClosePadding tells the distance between the close edges and its contents.

4.4 Position

ClosePosition tells where the close button is placed in the header. By default it is Right.

4.5 Others

ShowClose tells whether the close button is shown.

5. Icon

5.1 Image

Icon tells the image to be displayed.

IconImageSizeMode tells the sizing mode of the Icon Image.

5.2 Size

IconPadding tells the distance between the Icon edges and its contents.

5.3 Position

IconPosition tells where the Icon is placed in the toast. By default it is Left.

5.4 Others

ShowBodyIcon tells whether the Icon is shown.

6. Loader

6.1 Colors

LoaderBackColor tells the background color of the loader.

6.2 Size

LoaderHeight tells the height or the thickness of the loader

6.3 Position

LoaderPosition tells the position of the loader. Default it is Left.

6.4 Animation

IntervalInMilliseconds tells the interval in milliseconds between increments of the loader.

StopOnHover tells whether to loader pauses when mouse pointer is over it.

6.5 Others

LoaderVisible tells whether the loader is visible.

7. Methods

Close() closes last toast created by this toast instance.

CloseAnyAll() closes all toasts owned by this application.

Show() displays the toast on the screen in the defined position(toast1.Position = TopRight/TopLeft/BottomRight/BottomLeft) respecting OffSetX and OffSetY.

Show(Form) displays the toast on the defined form in the defined position(toast1.Position = TopRight/TopLeft/BottomRight/BottomLeft) respecting OffSetX and OffSetY.

Show(Point) displays the toast in the defined points on the screen. This doesn't respect OffSetX and OffSetY.

8. Events

Closed fires when a toast is closed. The reason can be; the user has closed it, the loader has finished(if AutoClose is true), you have closed it with Close() or CloseAnyAll() or it has been closed by another toast(if that toast has ClosePreviousToast set true).

saaToast1.Closed += SaaToast1_Closed;
private void SaaToast1_Closed1(object sender, EventArgs e)
  {
       SaaToast toast = (SaaToast)sender;
  // Rest of your code  
  }

Last updated