内置布尔到可见性转换器无法编译

问题描述 投票:0回答:1

我正在尝试使用自动 IReference 到可见性转换将可见性绑定到

ToggleButton::IsChecked

<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center"> <CheckBox x:Name="myButton" Content="Click Me" /> <TextBlock Text="Hello" Visibility="{x:Bind myButton.IsChecked, Mode=OneWay}"/> </StackPanel>
在空白项目中这是可行的。在我现有的项目中,如果我提供自己的转换器,它就会工作,但如果我尝试使用自动转换,我会得到:

error C3779: 'winrt::impl::consume_Windows_Foundation_IReference< winrt::Windows::Foundation::IReference<bool>,T>::Value': a function that returns 'auto' cannot be used before it is defined with [ T=bool ] (compiling source file Generated Files\XamlTypeInfo.g.cpp)
    
visual-c++ c++-winrt
1个回答
0
投票
如果针对 c++17 进行编译,错误就会消失。我正在为 c++20 编译

https://github.com/microsoft/microsoft-ui-xaml/issues/9214

© www.soinside.com 2019 - 2024. All rights reserved.