-
Notifications
You must be signed in to change notification settings - Fork 797
Open
Labels
area-C++/WinRTIssues related with C++/WinRT experienceIssues related with C++/WinRT experiencebugSomething isn't workingSomething isn't working
Description
Describe the bug
If I understand this documentation correctly, when elements has x:Load=False, it should not evaluate x:Bind expression. But my getters are still called. This only happens in C++WinRT project, and does not happens in C#.
Why is this important?
This is a major blocker for me using x:Load with my model, and a major discrepancy to the documentation.
Steps to reproduce the bug
- Create a C++winui3 project using the default template
- Use this xaml
<TextBlock
x:Name="Text"
x:Load="False"
Text="{x:Bind MyProperty}" />- Use this code
int32_t MainWindow::MyProperty()
{
OutputDebugString(L"Getter called when it is not supposed to\n");
return 42;
}- Put a breakpoint, on the line and build and run the app
- The breakpoint is hit, and the message is printed.
The equivalent C# code is working as expected!
public int MyProperty
{
get
{
Debug.WriteLine("Getter called when it is not supposed to");
return 42;
}
}Actual behavior
No response
Expected behavior
No response
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.8.3: 1.8.251106002
Windows version
Windows 11 (24H2): Build 26100
Additional context
Metadata
Metadata
Assignees
Labels
area-C++/WinRTIssues related with C++/WinRT experienceIssues related with C++/WinRT experiencebugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog