我引用了 this way ,并创建我的 DataGrid
。
但是我在调用命令时需要使用参数。
我看到这是一个 MS.Internal.Data.CollectionViewGroupInternal
类型,但我不知道如何转换它。
“MS.Internal.Data.CollectionViewGroupInternal”有项目和它的名字,我怎样才能得到它?或者,我可以将我的参数绑定(bind)到 CommandParameter
,可能像 DataGrid
的 SelectedItem
,因为我有一个 DependencyProperty
单击 Expander
。
public class ExpanderDataGrid : DataGrid
{
public string SelectedExpanderName
{
get
{
return (string)GetValue(SelectedExpanderNameProperty);
}
set
{
SetValue(SelectedExpanderNameProperty, value);
}
}
public static readonly DependencyProperty SelectedExpanderNameProperty = DependencyProperty.Register("SelectedExpanderName",
typeof(string), typeof(ExpanderDataGrid),
new FrameworkPropertyMetadata("",
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
}
最佳答案
我从here中找到了答案.
我可以将它转换为 CollectionViewGroup
,然后得到它。
关于c# - 如何转换 'MS.Internal.Data.CollectionViewGroupInternal'使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43798626/