Ejemplo n.º 1
0
        //Differentiates ElementMenu interaction from drag/drop interaction using minimum distance
        //Once minimum distance met, create copy to leave in original spot
        private void L1Module_ContainerManipulationDelta(object sender, ContainerManipulationDeltaEventArgs e)
        {
            try
            {
                Point current = this.Center;
                if (Math.Abs(Original.Y - current.Y) > 10 || Math.Abs(Original.X - current.X) > 10)
                {
                    L1Module l = sender as L1Module;
                    myClone             = l.clone();
                    myClone.Center      = Original;
                    myClone.BorderBrush = l.BorderBrush;

                    ScatterView parent = l.Parent as ScatterView;
                    parent.Items.Add(myClone);

                    if ((parent.Name == "L1_permTab") || (parent.Name == "L1_manTab"))
                    { //Check if in Level1 and give clone L1-appropriate behavior
                        myClone.Opacity = 0.5;
                        myClone.IsManipulationEnabled = false;
                    }
                    else
                    { //Moving L1Module within L2
                        l.changeParents_SV(parent, sw1.L2.L2_SV);
                    }

                    //Prevent it from continuously creating copies
                    l.ContainerManipulationDelta -= L1Module_ContainerManipulationDelta;
                }
            }
            catch (Exception exc) { Console.WriteLine("L1M Delta \n" + exc); }
        }