小编Raj*_*aja的帖子

ViewModel应该在WPF中继承DependencyObject吗?

我尝试使用MVVM在WPF中创建一个简单的UserControl.现在我需要为UserControl创建一个依赖项属性,所以我尝试在UserControlViewModel中创建依赖项属性(我不想在代码隐藏中).

为了在UserControlViewModel中创建依赖项属性,我需要从DependencyObject继承.在UserControlViewModel中继承DependencyObject是一个好习惯吗?也就是说,它是一个跟踪MVVM设计UserControl的好方法吗?

c# wpf user-controls dependency-properties mvvm

2
推荐指数
1
解决办法
2222
查看次数

标签 统计

c# ×1

dependency-properties ×1

mvvm ×1

user-controls ×1

wpf ×1