Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

FlexPanel vs TextTrimming/TextWrapping #103

Open
kerams opened this issue Jan 25, 2025 · 1 comment
Open

FlexPanel vs TextTrimming/TextWrapping #103

kerams opened this issue Jan 25, 2025 · 1 comment

Comments

@kerams
Copy link

kerams commented Jan 25, 2025

Consider

<StackPanel Orientation="Vertical">
  <Grid ColumnDefinitions="*,Auto">
    <TextBlock TextTrimming="CharacterEllipsis">aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa</TextBlock>
    <TextBlock Grid.Column="1">MUST BE VISIBLE</TextBlock>
  </Grid>
  <panels:FlexPanel Direction="Row">
    <TextBlock TextTrimming="CharacterEllipsis">aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa</TextBlock>
    <TextBlock>MUST BE VISIBLE</TextBlock>
  </panels:FlexPanel>
</StackPanel>

which produces

Image

I appreciate the fact that trimming kicks in, but don't understand why this particular width was chosen. Either trimming should be used to the fullest effect so that the other element is able to use all the space it needs (like in the grid), or there should be no trimming without being more specific as to what should happen (like in CSS).

@kerams kerams changed the title FlexPanel vs TextTrimming FlexPanel vs TextTrimming/TextWrapping Jan 25, 2025
@kerams
Copy link
Author

kerams commented Jan 25, 2025

And this is what happens with wrapping - the overflow on the second element is exactly the same

<StackPanel Orientation="Vertical">
  <Grid ColumnDefinitions="*,Auto">
    <TextBlock TextWrapping="Wrap">aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa</TextBlock>
    <TextBlock Grid.Column="1">MUST BE VISIBLE</TextBlock>
  </Grid>
  <panels:FlexPanel Direction="Row">
    <TextBlock TextWrapping="Wrap">aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa</TextBlock>
    <TextBlock>MUST BE VISIBLE</TextBlock>
  </panels:FlexPanel>
</StackPanel>

Image

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

No branches or pull requests

1 participant