Skip to content

Conversation

@apachezy
Copy link
Contributor

@apachezy apachezy commented Dec 27, 2025

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

  • When InfoBar's IsOpen property is set to false, the internal element “InfoBarRoot” is collapsed, but the InfoBar control itself remains visible in layout. This causes the margin and padding of InfoBar to still occupy space.

    Example usage:

    <Border
        Grid.Column="0"
        VerticalAlignment="Center"
        Background="Aquamarine">
        <ui:InfoBar
            Title="Title"
            Grid.Column="0"
            Margin="0 20"
            IsOpen="{Binding ViewModel.IsShortInfoBarOpened, Mode=TwoWay}"
            Message="Essential app message."
            Severity="{Binding ViewModel.ShortInfoBarSeverity, Mode=OneWay}" />
    </Border>

    Example:

    InfoBar-close-RootGrid.mp4
  • When the Title is empty, the space occupied by its TextBlock is not released, causing the TextBox displaying the Message to be squeezed out.

    TitleBar-title1
  • Currently, the InfoBar lacks appropriate border colors for different severity levels, and there are no suitable resource keys available even when customizing its style.


What is the new behavior?

  • InfoBar will be truly “closed” and will not occupy any layout space.

    Example:

    InfoBar-close-Self.mp4
  • When the Title is empty, the Message aligns to the position where the Title would be.

    TitleBar-title2
  • Four new brush keys have been added to the existing themes: InfoBarErrorSeverityBorderBrush, InfoBarWarningSeverityBorderBrush, InfoBarSuccessSeverityBorderBrush, and InfoBarInformationalSeverityBorderBrush. These allow developers to easily override and customize the styles. Please note that, to maintain consistency with WinUI InfoBar behavior, the corresponding color values remain unchanged.

Other information

@github-actions github-actions bot added controls Changes to the appearance or logic of custom controls. styles Topic is related to styles PR Pull request release dotnet labels Dec 27, 2025
@apachezy apachezy changed the title fix(controls): InfoBar should Collapse itself when closed fix(controls): Fixed issues with InfoBar Dec 29, 2025
@apachezy apachezy force-pushed the fix/infobar-close-self branch from 8e4ef00 to 00b92c5 Compare December 29, 2025 08:51
@apachezy apachezy marked this pull request as draft December 29, 2025 15:22
@apachezy apachezy marked this pull request as ready for review December 29, 2025 15:41
@apachezy apachezy force-pushed the fix/infobar-close-self branch from 00b92c5 to 24a4188 Compare December 29, 2025 15:49
- InfoBar will be truly “closed” and will not occupy any layout space.

- When the Title is empty, the Message aligns to the position where the Title would be.

- Add four new InfoBar severity border brush keys for theme customization while preserving default color values for WinUI compatibility.
@apachezy apachezy force-pushed the fix/infobar-close-self branch from 24a4188 to 8de9717 Compare December 29, 2025 15:52
@pomianowski pomianowski merged commit 058dca6 into lepoco:main Jan 10, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

controls Changes to the appearance or logic of custom controls. dotnet PR Pull request release styles Topic is related to styles

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants