本文介绍了使用内容控件打破MVVM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只是一个小问题,但我今天到目前为止还没有找到答案,所以我想我只是问问自己。



如果我放了一个contentcontrol在我的视图中,它的内容绑定到一个属性,然后在我的viewmodel中构建一个DataGridView并将该属性设置为破坏MVVM?



基本上我的应用程序需要在不同情况下有一个具有不同列的DataGrid。



我已阅读过关于在视图上放置DataGrid然后绑定到columncollection并使用行为等的内容。



我觉得使用内容控件真的会更容易但是必须有一个原因我找不到很多(或任何)有关天气打破MVVM的信息。



我尝试了什么:



Goole,CodeProject,StackOverflow

解决方案

Just a small question but i haven't found an answer to it so far today so i thought i'd just ask myself.

If i place a contentcontrol in my view with it's contents bound to a property, then build a DataGridView in my viewmodel and set that property to it is that breaking MVVM?

Basically my application needs to have a DataGrid that has different columns in different circumstances.

I have read about placing a DataGrid on the view then binding to a columncollection and using behaivours and such.

I felt using a contentcontrol would just be easier really but there must be a reason i can't find many (or any) information on weather that breaks MVVM or not.

What I have tried:

Goole, CodeProject, StackOverflow

解决方案


这篇关于使用内容控件打破MVVM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 04:40