Skip to main content

BubbleEventArgs

Namespace: Wisej.Web.Ext.Bubbles

Assembly: Wisej.Web.Ext.Bubbles (4.1.0.0)

Represents the event data for the Click event, providing information about the click action on a bubble notification.

public class BubbleEventArgs : EventArgs

This class contains properties that may provide details regarding the bubble notification's state and the context in which the click event occurred. It is primarily used to handle user interactions with bubble notifications, enabling further actions based on the user's input.

Constructors​

Instance member BubbleEventArgs(control, value)​

Initializes a new instance of the BubbleEventArgs class.

NameTypeDescription
controlControlThe control associated with the clicked bubble.
valueInt32The value in the bubble.

Properties​

Instance member Control​

Control: Returns the control associated with the bubble notification.

Value: The Control associated with the bubble.

This property is utilized to retrieve the control that triggered the bubble event, providing context for further processing or handling.

Example:

The following example attaches a bubble to a button, shows the value 7 using the Critical style, and handles the Click event.

var button = new Button
{
Name = "buttonMessages",
Text = "Messages",
Location = new Point(50, 50),
Size = new Size(120, 40)
};
this.Controls.Add(button); // add first, so the control is created.

var bubbles = new BubbleNotification
{
Alignment = ContentAlignment.TopRight,
Margin = new Padding(4)
};

bubbles.SetBubbleValue(button, 7); // 0 hides the bubble.
bubbles.SetBubbleStyle(button, BubbleStyle.Critical);

bubbles.Click += (s, e) =>
{
if (e.Control == button)
AlertBox.Show($"Bubble clicked on {e.Control.Name}");
};

Instance member Value​

Int32: Gets the integer value displayed in the bubble notification that was clicked.

Value: An integer representing the value contained in the clicked bubble notification.

This property is part of the BubbleEventArgs class and is used to retrieve the value relevant to the event that triggered the bubble notification.

Example:

The following example attaches a bubble to a button, shows the value 7 using the Critical style, and handles the Click event.

var button = new Button
{
Name = "buttonMessages",
Text = "Messages",
Location = new Point(50, 50),
Size = new Size(120, 40)
};
this.Controls.Add(button); // add first, so the control is created.

var bubbles = new BubbleNotification
{
Alignment = ContentAlignment.TopRight,
Margin = new Padding(4)
};

bubbles.SetBubbleValue(button, 7); // 0 hides the bubble.
bubbles.SetBubbleStyle(button, BubbleStyle.Critical);

bubbles.Click += (s, e) =>
{
if (e.Control == button)
AlertBox.Show($"{e.Value} new messages");
};

Used By​

NameDescription
BubbleEventHandlerRepresents the method that will handle the Click event.