You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code generated to read an hstring property in an x:Bind is missing boxing, and is causing the following error: error C2679: binary '=': no operator found which takes a right-hand operand of type 'winrt::hstring' (or there is no acceptable conversion)
Compile the project; compilation will fail with ...\Generated Files\MainPage.xaml.g.hpp(259,21): error C2679: binary '=': no operator found which takes a right-hand operand of type 'winrt::hstring' (or there is no acceptable conversion)
at
voidUpdate_ViewModel_Name(::winrt::hstring obj, int32_t phase)
{
if((phase & ((1 << 0) | NOT_PHASED | DATA_CHANGED)) != 0)
{
// MainPage.xaml line 14if (obj2)
{
// obj is properly boxed hereSet_Windows_UI_Xaml_Controls_ToolTipService_ToolTip(obj2, ::winrt::box_value(obj), std::nullopt);
}
else
{
// obj is not boxed here
obj2ToolTipDeferredValue = obj;
}
}
}
Expected behavior
This code compiles the string property is properly bound.
Screenshots
No response
NuGet package version
None
Windows version
Windows 11 (22H2): Build 22621, Windows 11 (21H2): Build 22000
Additional context
Workarounds:
The issue doesn't repro without x:Load. If using Visibility instead is acceptable, the code will compile and work.
The same error will be raised in MainWindow.xaml.g.hpp MainWindow.xaml.g.hpp(297,21): error C2679: binary '=': no operator found which takes a right-hand operand of type 'winrt::hstring'
Describe the bug
The code generated to read an hstring property in an x:Bind is missing boxing, and is causing the following error:
error C2679: binary '=': no operator found which takes a right-hand operand of type 'winrt::hstring' (or there is no acceptable conversion)
Steps to reproduce the bug
x:Load
is present, the error doesn't appear without it:...\Generated Files\MainPage.xaml.g.hpp(259,21): error C2679: binary '=': no operator found which takes a right-hand operand of type 'winrt::hstring' (or there is no acceptable conversion)
at
Expected behavior
This code compiles the string property is properly bound.
Screenshots
No response
NuGet package version
None
Windows version
Windows 11 (22H2): Build 22621, Windows 11 (21H2): Build 22000
Additional context
Workarounds:
x:Load
. If usingVisibility
instead is acceptable, the code will compile and work.The text was updated successfully, but these errors were encountered: