如何转换“MS.Internal.Data.CollectionViewGroupInternal”来使用?

Po-*_*ang 8 c# data-binding wpf datagrid

我参考这种方式,并创建我的DataGrid.

但我在调用命令时需要使用参数。

我看到这是一种MS.Internal.Data.CollectionViewGroupInternal类型,但我不知道如何转换它。

“MS.Internal.Data.CollectionViewGroupInternal”有项目及其名称,我如何获取它?或者,我可以将我的参数绑定到CommandParameter,也许像SelectedItemof DataGrid,因为我有一个DependencyPropertyfor click 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));
    }
Run Code Online (Sandbox Code Playgroud)

Po-*_*ang 10

我从这里找到答案。

我可以将其投射到CollectionViewGroup,然后得到它。