该成员未被识别或无法访问

时间:2015-02-11 09:18:48

标签: c# wpf xaml

在我的WPF中我有

public class AttachedColumnBehavior
{        


    public static readonly DependencyProperty MappedValuesProperty =
            DependencyProperty.RegisterAttached("MappedValues",
            typeof(MappedValueCollection),
            typeof(AttachedColumnBehavior),
            new UIPropertyMetadata(null, OnMappedValuesPropertyChanged));

}

   public static MappedValueCollection GetMappedValues(DependencyObject dataGrid)
    {
        return (MappedValueCollection)dataGrid.GetValue(MappedValuesProperty);
    }

    public static void SetMappedValues(DependencyObject dataGrid, MappedValueCollection value)
    {
        dataGrid.SetValue(MappedValuesProperty, value);
    }

在我的Xaml中我有

<DataGrid ItemsSource="{Binding MyCollectoin}" x:Name="myGrid" 

                  loc:AttachedColumnBehavior.MappedValues="{Binding MyCollectionValues}"                      
                  AutoGenerateColumns="False">
            <DataGrid.Columns>

但我收到The Member MappedValues is not recognized or is not acessible错误。

0 个答案:

没有答案