将ListBox项目拖出ListBox Windows Phone 8中

时间:2013-07-18 05:16:36

标签: windows-phone-7 xaml windows-phone-8

我有一个示例数据绑定到listbox datatemplate,每个项目都有一个带有ConstrainToParentBounds false的MouseDragElementBehavior。我想将列表框中的任何项目拖动到页面中的任何空间。但是,项目仍然限制在列表框中。有什么建议? AllowDrop属性在Windows Phone上不起作用。

<ListBox x:Name="countryName"  HorizontalAlignment="Left" Height="361" Margin="10,10,0,0" VerticalAlignment="Top" Width="436">
            <i:Interaction.Behaviors>
                <el:MouseDragElementBehavior ConstrainToParentBounds="False"/>
            </i:Interaction.Behaviors>
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <TextBlock Text="{Binding Name}">

                        </TextBlock>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

0 个答案:

没有答案