Skip to content

BindingContext changes after being added to Canvas #119

Answered by taublast
sferhah asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @sferhah. Maybe i am wrong but this is intended behaviour you can adjust for your needs.

  1. Parents always propagate their BindingContext to children, when child has its Parent property set. This is by design.
  2. You can change this for a specific control if you need a different behavior:

I see your main problem occurs when you add your layout to canvas, and canvas sets its context. so you can have a custom wrapper denying this context:

Would suggest to always use a wrapper layout inside canvas even you want to use just one control, like button or label. Why? For potential overlays and to be able to cache your control when it has some surrounding stuff like shadows. In this case you would …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by sferhah
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@taublast
Comment options

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 #117 on November 11, 2024 18:09.