从LibraryContainer拖放只能每个项目执行一次

从LibraryContainer拖放只能每个项目执行一次

本文介绍了从LibraryContainer拖放只能每个项目执行一次?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我刚刚实施了从图书馆容器拖放到SurfaceWindow中。效果很好。


我遇到的唯一问题是,一旦你将图书馆容器中的项目拖放到SurfaceWindow中,它就会将它从LibraryContainer中移除(好吧它会变暗和不可拖动) )再也不能拖了。我收集这个是设计的功能,
,但我希望用户能够从LibraryContainer重复拖放相同的项目。


我看到shoppingCart示例在某种程度上完成了重新绘制掉落的物品。但我似乎无法正确连接s:SurfaceDragDrop.DragCompleted事件,因为它永远不会触发。这是我的libraryContainer:



  &NBSP; < s:LibraryContainer Name =" lbCtReportMenu" ViewingMode = QUOT;酒吧及QUOT;&NBSP; >

            < S:LibraryContainer.StackView>

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < S:StackView的ItemTemplate = QUOT; {StaticResource的LibraryItemTemplate}">

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP ;&NBSP;&NBSP; < / s:StackView>

            < / s:LibraryContainer.StackView>

            < S:LibraryContainer.BarView>

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; < S:BarView&NBSP;&NBSP;的ItemTemplate = QUOT; {StaticResource的LibraryItemTemplate}"

&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP; >&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;


                < / s:BarView>&
            < / s:LibraryContainer.BarView>

        < /秒:LibraryContainer>


这是我的surfaceWindow代码(这是挂接在XAML定义surfacewindow Drop事件):


&NBSP ; private void SurfaceWindow_Drop(object sender,SurfaceDragDropEventArgs e)

        {


//已将报告删除到屏幕上执行操作....


        ;&NBSP;&NBSP;&NBSP;&NBSP; e.Handled = true;

        }



任何我出错的想法?​​



谢谢






解决方案

Hi All, ive just implemented drag and drop from a Library Container into a SurfaceWindow. Works great.

Only problem I had is that once you drag and drop and item from the Library Container into the SurfaceWindow it removes it from the LibraryContainer (well leaves it as dark and un-draggable) and cant be dragged again. Im gathering this is designed functionality, but I want the user to be able to repeatedly drag and drop the same items from the LibraryContainer.

I see the shoppingCart example accomplishes by somewhat repainting the items it drops. But I cant seem to hook up the s:SurfaceDragDrop.DragCompleted event correctly as it never fires. Here is my libraryContainer:

    <s:LibraryContainer Name="lbCtReportMenu" ViewingMode="Bar"  >
            <s:LibraryContainer.StackView>
                <s:StackView ItemTemplate="{StaticResource LibraryItemTemplate}">
                </s:StackView>
            </s:LibraryContainer.StackView>
            <s:LibraryContainer.BarView >
                <s:BarView   ItemTemplate="{StaticResource LibraryItemTemplate}"
                           >     
                </s:BarView>
            </s:LibraryContainer.BarView>
        </s:LibraryContainer>

This is my surfaceWindow code (this is hooked up the surfacewindow Drop event in the xaml definition):

 private void SurfaceWindow_Drop(object sender, SurfaceDragDropEventArgs e)
        {

//REPORT HAS BEEN DROPPED ONTO SCREEN DO ACTIONS ....

            e.Handled = true;
        }

Any ideas where im going wrong?

Thanks

解决方案


这篇关于从LibraryContainer拖放只能每个项目执行一次?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 16:25