c# - WPF c# .net 框架 4.8 x :Bind

标签 c# wpf xbind

我读到了x:Bind , 性能优于 Binding .但是在我使用 .NET Framework 4.8 的应用程序 WPF C# 中,当我输入 x:Bind 时在任何部分 (TextBox Text="{x:Bind ...}"),Visual Studio 对我说“Windows Presentation Foundation (WPF) 项目不支持绑定(bind)。”
你不可能 x:Bind 在 WPF C# Application for Desktop 中吗?或者我需要做什么才能使用它?

最佳答案

恐怕x:Bind目前仅在通用 Windows 平台 (UWP) 中支持,在 WPF/.NET Framework 中不支持,因此错误消息是正确的。

您可以使用 XAML Islands 在 WPF 应用程序中托管 UWP 控件但是没有办法直接在 WPF 依赖属性上使用已编译的绑定(bind)。

关于c# - WPF c# .net 框架 4.8 x :Bind,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60153403/

相关文章:

c# - 如何在 UWP ListView 中拥有多个数据模板 (x :bind)

c# - TickCount 重置事件?

c# - 为什么 DateTime.AddHours 似乎不起作用?

c# - 使用 x :Bind 通过 Converter 绑定(bind)到当前 DataContext

wpf - MVVM 真的有用吗?

c# - 在流文档 wpf 中搜索多个单词和表达式

linq - x :Bind type can't be found

c# - 将一定数量的行从 DataReader 加载到数据表中

c# - 接受数字 0 到 9999 的正则表达式

wpf - 如何显示绑定(bind)到空列表的 WPF 列表框的默认值