Ejemplo n.º 1
0
        private void MediaGrid_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            MediaDisplay md     = dockedMedia;
            ICanDock     target = md.Tag as ICanDock;

            Undock(md);
            target.Dock(md);
        }
Ejemplo n.º 2
0
        private void ImageContainer_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            FrameworkElement current = this.Parent as FrameworkElement;
            ICanDock         target  = null;

            while (current != null)
            {
                target = current as ICanDock;
                if (target != null)
                {
                    break;
                }
                current = current.Parent as FrameworkElement;
            }

            if (target != null)
            {
                Undock(mediaDisplay);
                target.Dock(mediaDisplay);
                OnMouseLeave(null);
                e.Handled = true;
            }
        }