WPF,DataTemplate,Converter不会触发

时间:2015-09-11 12:56:01

标签: wpf xaml converter

我在使用DataTemplate时遇到多绑定转换器的问题。当我删除DataTemplate时,转换器被触发。 这是我的XAML:

<ListView x:Name="lstADUsers" Margin="20,5,0,20" Width="420" ScrollViewer.HorizontalScrollBarVisibility="Disabled"  ItemsSource="{Binding ADUsers}" FontSize="11">
            <ListView.View>
                <GridView ColumnHeaderContainerStyle="{StaticResource myHeaderStyle}">
                     <GridViewColumn Width="420" Header="User">
                        <GridViewColumn.CellTemplate>
                            <DataTemplate>
                                <TextBlock Margin="2,2,2,2" Grid.Column="1" Width="Auto">
                                    <TextBlock.Text>
                                        <MultiBinding Converter="{StaticResource ADUserConverter}">
                                            <Binding Path="UserID"/>
                                            <Binding Path="Surname"/>
                                            <Binding Path="GivenName"/>
                                        </MultiBinding>
                                    </TextBlock.Text>
                                </TextBlock>
                            </DataTemplate>
                        </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                </GridView>
            </ListView.View>
        </ListView>

你知道可能是什么问题吗?

0 个答案:

没有答案