我尝试使用MVVM在WPF中创建一个简单的UserControl.现在我需要为UserControl创建一个依赖项属性,所以我尝试在UserControlViewModel中创建依赖项属性(我不想在代码隐藏中).
为了在UserControlViewModel中创建依赖项属性,我需要从DependencyObject继承.在UserControlViewModel中继承DependencyObject是一个好习惯吗?也就是说,它是一个跟踪MVVM设计UserControl的好方法吗?
c# wpf user-controls dependency-properties mvvm
c# ×1
dependency-properties ×1
mvvm ×1
user-controls ×1
wpf ×1