Skip to content

unable to find a setter #18216

Answered by maxkatz6
SaadAlmuneef asked this question in Q&A
Discussion options

You must be logged in to vote

Window content, as well as majority of other controls with content, can only have a single child set. In your code you have two children - text block and a button.

If you want to arrange multiple children at the same parent, you need to add a Panel. There are different panels with different arrangement rules (StackPanel, WrapPanel, Grid...).
For example:

<Window ...>
    <StackPanel>
          Welcome To Avalonia!
          <Button Content="Hello" />
    </StackPanel>
</Window>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by SaadAlmuneef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #18215 on February 16, 2025 22:33.