AllowDrop = false不能正常工作WPF

时间:2017-12-05 07:54:25

标签: wpf xaml drag-and-drop

我只将AllowDrop设置为叶节点,将AllowDrop = false设置为其他,但设置AllowDrop = false后仍然允许Drop选项。

<TreeView x:Name="tvParameters" >
        <TreeView.Resources>
            <HierarchicalDataTemplate DataType="{x:Type loc:MyTreeViewItem}" ItemsSource="{Binding SubItems}">
                <Grid >
                <TextBlock Text="{Binding Path=FullName}" x:Name="tbFullParameter" Visibility="Collapsed"/>
                    <TextBlock Text="{Binding Path=Name}" AllowDrop="{Binding Path=AllowDrop}"  x:Name="tbParameter" PreviewMouseLeftButtonDown="tbParameter_PreviewMouseLeftButtonDown" PreviewMouseMove="tbParameter_PreviewMouseMove"/>
                <!--<TextBlock Text="{Binding Name}"/>-->
                </Grid>
            </HierarchicalDataTemplate>
        </TreeView.Resources>
    </TreeView>

0 个答案:

没有答案