日期:2014-05-20 浏览次数:20804 次
<DataGrid Name="dtgNodesInfo"
ItemsSource="{Binding ElementName=nodesSetCtrl,
Path=NVS4Binding.NodeList,
Converter={StaticResource testConverter}}">
</DataGrid>
class TestConverter : IValueConverter
{
public object Convert(object values, Type targetType, object parameter, CultureInfo culture)
{
Debug.WriteLine("Binding is in");
return values;//断点
}
public object ConvertBack(object value, Type targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
<DataGrid.Columns>
<DataGridTextColumn Header="网络号"
Binding="{Binding Path=Net,
Converter={StaticResource testConverter}}"/>
<DataGridTextColumn Header="短地址"
Binding="{Binding Path=Address,
Converter={StaticResource testConverter}}"/>
</DataGrid.Columns>