Update x:Load attribute documentation#6005
Open
hoshiizumiya wants to merge 1 commit into
Open
Conversation
Clarified restrictions and usage notes for x:Load attribute, including details on x:Bind interactions and error handling.
Contributor
|
@hoshiizumiya : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Contributor
|
@hoshiizumiya : Thanks for your contribution! The author(s) and reviewer(s) have been notified to review your proposed change. |
Contributor
|
Learn Build status updates of commit d693e80: ✅ Validation status: passed
For more details, please refer to the build report. |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the x:Load attribute documentation to clarify platform-specific restrictions (notably WinUI 3 Window root scenarios) and to add guidance about x:Bind interactions and known C++/WinRT limitations.
Changes:
- Added a CAUTION note about
FindNamebehavior when the XAML root element is a WinUI 3Window. - Expanded
x:Bindguidance to mention a naming collision that can trigger XAML compiler errors. - Added new “Restrictions” bullets linking to known C++/WinRT issues/workarounds.
Comment on lines
+21
to
+22
| > [!Caution] | ||
| > Regarding the 'Window' is not a DependencyObject. You can not use it in which the xaml root is the Window because the [FindName method](/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.frameworkelement.findname) needs. Check it at https://github.com/microsoft/microsoft-ui-xaml/issues/9842. |
| There are several different ways to load the elements: | ||
|
|
||
| - Use an [x:Bind](x-bind-markup-extension.md) expression to specify the load state. The expression should return **true** to load and **false** to unload the element. | ||
| - Use an [x:Bind](x-bind-markup-extension.md) expression to specify the load state. The expression should return **true** to load and **false** to unload the element. The x:Name you set and the x:Bind binding name should not be the same if you use x:Bind in the x:Load or the xaml complier will report an error. |
Comment on lines
+71
to
+72
| - In the C++/WinRT, Compile error when using x:Load and x:Bind. Check it and workaround at https://github.com/microsoft/microsoft-ui-xaml/issues/7579. | ||
| - In the C++/WinRT, FindName wont reload an object that has been UnloadObjected. Check it at https://github.com/microsoft/microsoft-ui-xaml/issues/10179. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clarified restrictions and usage notes for x:Load attribute, including details on x:Bind interactions and error handling.