System.Windows.Controls 中缺少 DataGridHeaderBorder
最近我将我的项目从.Net3.5 移至.Net4。在使用 DataGrid 的早期版本中,我使用的是 wpfToolkit
并且它工作正常。但在迁移到 .Net4 后,我不想显式添加对我的工具包的引用,因为 DataGrid 已移动到 Controls 命名空间下。
但是,除了 Controls 命名空间下的 DataGridHeaderBorder
之外,所有相关引用均已移动。要使用此功能,我们必须显式引用 PresentationFramework.Aero
。我提到了这些 URL -
WPF4 DataGridHeaderBorder in a xaml Style
但我无法添加由于 Aero 主题可能不适用于所有目标环境,因此我们的项目中使用了PresentationFramework.Aero。那么,有什么解决方法我可以尝试让它工作吗?我怎样才能从程序集PresentationFramework.Aero获取DataGridHeaderBorder的代码,以便我可以在我的代码中覆盖或子类化它。有什么帮助吗?
Recently i moved my project from .Net3.5 to .Net4. In earlier version to use DataGrid, i was using wpfToolkit
and its working fine. But after moving to .Net4 i don't want to explicitly add the refernce to my toolkit since DataGrid has been moved under Controls namespace.
But, all the related references have been moved except for the DataGridHeaderBorder
under Controls namespace. To use this we have to explicitly ad reference to PresentationFramework.Aero
. I referred to these URL's -
WPF4 DataGridHeaderBorder in a xaml Style
But i can't add the PresentationFramework.Aero to our project since Aero theme may not be present for all the target environments. So, is there any workaround i can try to get it working? Any how can i get the code from assembly PresentationFramework.Aero for DataGridHeaderBorder so that i can override or subclass it in my code. Any help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我想你可以下载
WPFToolkit
的最新源代码并从中提取DataGridHeaderBorder
样式。它有
DataGrid\Microsoft\Windows\Controls\DataGridHeaderBorder.cs
以及相应的Aero
、Classic
、Luna
主题DataGrid\Themes\*
也是如此。I think you could download latest source code of
WPFToolkit
and extractDataGridHeaderBorder
styles from it.It has
DataGrid\Microsoft\Windows\Controls\DataGridHeaderBorder.cs
and correspondingAero
,Classic
,Luna
themes inDataGrid\Themes\*
too.