Ejemplo n.º 1
0
        private static void Target_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            UIElement uIElement = sender as UIElement;

            if ((uIElement == null ? false : FloatingBlock.GetReadyToFloat(uIElement)))
            {
                AdornerLayer adornerLayer = AdornerLayer.GetAdornerLayer(uIElement);
                if (adornerLayer != null)
                {
                    AdornerContainer adornerContainer = new AdornerContainer(adornerLayer)
                    {
                        IsHitTestVisible = false,
                    };
                    adornerContainer.Child = FloatingBlock.CreateBlock(uIElement, adornerContainer);
                    adornerLayer.Add(adornerContainer);
                }
                FloatingBlock.SetReadyToFloat(uIElement, false);
            }
        }
Ejemplo n.º 2
0
 private static void Target_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
 {
     FloatingBlock.SetReadyToFloat(sender as DependencyObject, true);
 }