Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Longer text as Content in ContentDialog creates big blank space #1273

Open
symonxdd opened this issue Nov 9, 2024 · 0 comments
Open

Longer text as Content in ContentDialog creates big blank space #1273

symonxdd opened this issue Nov 9, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@symonxdd
Copy link

symonxdd commented Nov 9, 2024

Describe the bug

When a ContentDialog's Content property is set to a StackPanel that hosts at least one UI element like a TextBlock, then it creates a big empty gap (spacing) between the dialog content and the dialog buttons.

Thanks in advance and I just want to quickly say that I really appreciate this library and should have used it sooner for my projects! Pozdrowienia z Belgii panie Leszku 🥂🤍

To Reproduce

ContentDialog contentDialog = new()
{
  Title = "My dialog",
  CloseButtonText = "Cancel",
  PrimaryButtonText = "Those who know",
  DialogMaxWidth = 500,
  DialogMaxHeight = 200,
  DialogHost = RootContentDialog,
  Content = new StackPanel
  {
    Children =
    {
      new TextBlock
      {
        Text = "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.",
        TextWrapping = TextWrapping.Wrap
      }
    }
  }
};

The TextWrapping = TextWrapping.Wrap line has no effect on whether the issue occurs or not.

Expected behavior

The blank empty space should not be created, it should just have a slight default spacing, more or less like the spacing between the title and the content of the dialog.

Screenshots

  • When the text is too long, it creates a huge blank gap as can be seen here:
    image

  • When the text is short enough, the issue doesn't occur.
    image

OS version

Windows 11

.NET version

.NET 8.0

WPF-UI NuGet version

WPF UI v3.0.5

Additional context

I tested the same code but in a WinUI 3 (WinAppSDK) project and it strangely does not occur in that environment.

@symonxdd symonxdd added the bug Something isn't working label Nov 9, 2024
@symonxdd symonxdd changed the title StackPanel as Content in ContentDialog creates big blank space Longer text as Content in ContentDialog creates big blank space Nov 9, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant