Skip to content

feat(Alert): add Alert component - #4128

Draft
corvinsz wants to merge 4 commits into
MaterialDesignInXAML:masterfrom
corvinsz:feat/alert-component
Draft

corvinsz wants to merge 4 commits into
MaterialDesignInXAML:masterfrom
corvinsz:feat/alert-component

Conversation

@corvinsz

@corvinsz corvinsz commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Adds a new Alert component which supports all variations of the semantic colors.
The variant of an Alert can be specified by setting the Severity property. I purposely didn't name the enum AlertSeverity, because I think the enum can have use cases of other components too.

Overview of the public Api:

[TemplatePart(Name = "PART_CloseButton", Type = typeof(ButtonBase))]
public class Alert : ContentControl
{
    public const string CloseButtonPartName = "PART_CloseButton";

    public Severity Severity { get; set; }
    public CornerRadius CornerRadius { get; set; }
    public object? Title { get; set; }
    public PackIconKind? IconKind { get; set; }
    public bool ShowCloseButton { get; set; }

    public event RoutedEventHandler CloseClick;
}
image

@corvinsz
corvinsz marked this pull request as draft November 26, 2026 20:07
Add default DataTemplate so normal text wraps around

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant