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

Fix InlinesCollection Logical/VisualParent update #14679

Merged

Conversation

Gillibald
Copy link
Contributor

@Gillibald Gillibald commented Feb 21, 2024

What does the pull request do?

This PR makes sure we update the Logical/VisualParent when an InlinesCollection is attached/detached to/from a TextBlock

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes: #14670

@Gillibald Gillibald added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Feb 21, 2024
@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.1.999-cibuild0045183-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@wieslawsoltes
Copy link
Contributor

@Gillibald It fixes the issue but there seems to be difference in rendering result:

There is no space between Some text and buttons.

Inlines Directly

      <TextBlock>
        <TextBlock.Inlines>
          <Run>Some text</Run>
          <InlineUIContainer>
            <StackPanel>
              <Button Content="Button 1" />
              <Button Content="Button 2" />
            </StackPanel>
          </InlineUIContainer>
        </TextBlock.Inlines>
      </TextBlock>

image

Inlines InlineCollection

      <TextBlock>
        <TextBlock.Inlines>
          <InlineCollection>
            <Run>Some text</Run>
            <InlineUIContainer>
              <StackPanel>
                <Button Content="Button 1" />
                <Button Content="Button 2" />
              </StackPanel>
            </InlineUIContainer>
          </InlineCollection>
        </TextBlock.Inlines>
      </TextBlock>

image

@Gillibald
Copy link
Contributor Author

Some text

This is a XamlX issue

@wieslawsoltes wieslawsoltes added this pull request to the merge queue Feb 21, 2024
Merged via the queue into AvaloniaUI:master with commit 599cf1f Feb 21, 2024
6 checks passed
@Gillibald Gillibald deleted the fixes/inlinesUpdateVisualTree branch February 21, 2024 15:03
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Feb 22, 2024
maxkatz6 pushed a commit that referenced this pull request Feb 22, 2024
* Add failing test

* Update Visual/LogicalTree when parents change
#Conflicts:
#	src/Avalonia.Controls/Documents/InlineCollection.cs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InlineUIContainer is not rendered when added to new InlineCollection is set to Inlines
4 participants