绑定到主数据上下文,而不是行的

发布于 2024-12-03 20:34:02 字数 553 浏览 3 评论 0原文

我想将列的 itemsource 绑定到 xaml 的主数据上下文

在我这样做之前:

<telerik:GridViewComboBoxColumn Header="Type" DataMemberBinding="{Binding VehicleCondition}" ItemsSourceBinding="{Binding VehicleConditions,Source={StaticResource ShowroomLog}}"  />

但我删除了

从 app.xaml

和 showroomlogview.xaml 中我有声明

     xmlns:local="clr-namespace:WinITApp" DataContext="{Binding ShowroomLog, Source={StaticResource Locator}}">

“不,它没有找到我的车辆条件”,但我不知道如何更改此代码以使其正确。

怎样才能办身份证呢?

I want to bind itemsource of column to main datacontext of xaml

Before I had it done like that:

<telerik:GridViewComboBoxColumn Header="Type" DataMemberBinding="{Binding VehicleCondition}" ItemsSourceBinding="{Binding VehicleConditions,Source={StaticResource ShowroomLog}}"  />

but I removed

from app.xaml

and in showroomlogview.xaml I have declaration

     xmlns:local="clr-namespace:WinITApp" DataContext="{Binding ShowroomLog, Source={StaticResource Locator}}">

No it doesn't find me vehicleconditions, but I don't know how I can change this code to have this correct.

How can I do id?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

给妤﹃绝世温柔 2024-12-10 20:34:02

我用的是

"{Binding Source={StaticResource Locator}, Path=ShowroomLog.Handlers}"

I did it using

"{Binding Source={StaticResource Locator}, Path=ShowroomLog.Handlers}"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文