在我的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
错误。