当前位置:网站首页>BindingExpression path error: ‘selectMenusList‘ property not found on ‘object‘ ‘‘ViewModel“
BindingExpression path error: ‘selectMenusList‘ property not found on ‘object‘ ‘‘ViewModel“
2022-07-30 02:58:00 【太阳风暴】
BindingExpression path error: 'selectMenusList' property not found on 'object' ''ViewModel"
一、问题描述
1. 情况概述
在 使用WPF的 MVVM框架时,前端代码绑定 viewmodel代码里面出现
- BindingExpression path error: “属性字段” property not found on ‘object’ ‘’ viewmodel"
二、问题代码分析
- 前端代码
<ListBox Grid.Row="3" ItemsSource="{Binding SelectMenusList}" SelectedItem="{Binding SelcetMenu}"/>
- 后端代码
public List<string> SelectMenusList
public string SelcetMenu
三、解决办法
1. 原因分析
绑定的对象属性必须设置为依赖属性,也即是要 对属性 提供 get set 方法
2. 解决方法概述
把后端代码修改为如下
public List<string> SelectMenusList{
get; set;}
public string SelcetMenu{
get; set;}
边栏推荐
- Are you still using the command line to read logs?Quickly use Kibana, visual log analysis YYDS
- VMware磁盘扩容记录
- Mysql中事务是什么?有什么用?
- 成功解决AttributeError: ‘PngImageFile‘ object has no attribute ‘imshow‘
- 华宝新能通过注册:拟募资近7亿 营收增加利润反而下降
- 重写并自定义依赖的原生的Bean方法
- B. Inflation-Educational Codeforces Round 103 (Rated for Div. 2)
- OPENSQL
- Not enough information to list load addresses in the image map. (STM32 compilation error)
- gnss rtcm rtklib Ntrip...
猜你喜欢
随机推荐
运营人必须掌握的6大类26个基本模型
1050 graphics card, why is the graphics card usage ranking on Steam always the top five
HCIP 第十四天
自定义 View 实现汉字笔顺动画
NLP自然语言处理(一)
Not enough information to list load addresses in the image map.(STM32编译报错)
Oracle数据库表空间整理回收与释放操作
使用SqlSessionFactory工具类抽取
selenium应用之拉勾简历邀约数据抓取与分析
HCIP 第十五天
记录NLP各种资源网址
【C语言刷LeetCode】2295. 替换数组中的元素(M)
C# 一周入门之《C#-类和对象》Day Six
表达式计算器 ExpressionRunner
WebSocket在线通信
【C语言刷LeetCode】451. 根据字符出现频率排序(M)
自动配置和 thymeleaf模板引擎
HCIP实验(05)OSPF综合实验
Embedded SIG | 分布式软总线
uni-app实现跨端开发手机蓝牙接收和发送数据