Swapped xBind template ContentControl to ContentPresenter#297
Swapped xBind template ContentControl to ContentPresenter#297Avid29 wants to merge 1 commit intoCommunityToolkit:mainfrom
Conversation
…Control in ControlTemplate
98a36c0 to
e6ba606
Compare
|
This is on me and @Avid29 for not documenting the many struggles and iterations it took to put together an @Avid29 If you search for There's presumably good reason for such consistency, and it's consistency I wouldn't have expected if you really could arbitrarily swap them without side effects. Before a PR like this can happen, a few crucial questions need to be answered:
We need to be certain about these things before making changes. For most of these, it means checking for ourselves. Rather than doing this in PR, we should continue this investigation in a GitHub issue, a Discord thread, or both. |
|
@Arlodotexe My apologies. This was a simple change, so I went and made a branch with it. Though I should have put the PR body in a discussion or Discord #community-toolkit thread before opening a PR. |
@Arlodotexe This is in response to our conversation last night on why a
ContentControlwas used instead of aContentPresenterin the x:Bind template.I tried swapping it out, and it works with no issues.
I also am beginning to remember that the reason we used a
ContentControlin Strix has something to do with VisualStates or StateTriggers or something like that, none of which is present in this project template.I also found more info on how the UserControl is different from the
ControlorContentControl. It appears theUserControlis basically aContentControlwith no templating. Therefore, it has aContentproperty, but its type isUIElement, notobject.Anyway, here's a PR that reduces the visual tree depth of the x:Bind template by directly using a
ContentPresenterin theControlTemplaterather than aContentControlwhich will simply wrap aContentPresenter.