Skip to content

Conversation

@edgarfgp
Copy link
Member

@edgarfgp edgarfgp commented Nov 16, 2025

Fixes #292 (comment)

  • IsClosed is a completion state that triggers NotificationClosed event; it doesn’t itself hide the card.
  • To close visually using the control’s own behaviour, you must call Close() (drive IsClosing).
  • If you only need to show/hide in the sample, prefer .isVisible(...) or conditional rendering.

So let's remove IsClosed modifier as it is not meant to be used to close the card. Also change NotificationClosed to be a RoutedEvent.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes the NotificationCard API by removing the confusing IsClosed parameter and properly handling the NotificationClosed event as a routed event.

  • Removes the IsClosed parameter from NotificationCard constructors, as it doesn't control visual state
  • Converts NotificationClosed from a regular event to a RoutedEvent using defineRoutedEvent
  • Updates the sample to use conditional rendering instead of the removed IsClosed parameter

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Fabulous.Avalonia/Views/Controls/Notifications/NotificationCard.fs Removed IsClosed attribute and simplified NotificationCard builders to remove the confusing isClosed parameter
src/Fabulous.Avalonia/Views/Controls/Notifications/NotificationCard.Mvu.fs Changed NotificationClosed from defineEvent to defineRoutedEvent for proper routed event handling
src/Fabulous.Avalonia/Views/Controls/Notifications/NotificationCard.Components.fs Changed NotificationClosed from defineEvent to defineRoutedEvent for proper routed event handling
samples/Gallery/Pages/NotificationsPage.fs Updated sample to use conditional rendering instead of IsClosed, removed obsolete TODO comment, and minor cleanup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@edgarfgp edgarfgp merged commit 73ab7ad into main Nov 16, 2025
7 checks passed
@edgarfgp edgarfgp deleted the fix-notification-card branch November 16, 2025 19:45
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.

2 participants