Пример #1
0
        private void DockPanel_Header_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (this.LLCheckbox_IsClip.IsChecked == true)
            {
                return;
            }

            var parent = (Panel)this.Parent;

            var height = this.ActualHeight + 44;
            var width  = this.ActualWidth + 14;



            Window OwnerWindow;

            OwnerWindow = Window.GetWindow(this);

            var posx = e.GetPosition(OwnerWindow).X / OwnerWindow.ActualWidth;
            var posy = e.GetPosition(OwnerWindow).Y / OwnerWindow.ActualHeight;

            parent.Children.Remove(this);
            Windows.FloatingWindow p = new Windows.FloatingWindow();
            p.Style = (Style)App.Current.Resources["WindowStyle"];
            p.Add(this);
            p.Show();

            p.Height = height;
            p.Width  = width;

            p.Left = OwnerWindow.Left;
            p.Top  = OwnerWindow.Top;
            if (e.MouseDevice.LeftButton == System.Windows.Input.MouseButtonState.Pressed)
            {
                p.DragMove();
            }
            else
            {
                Console.WriteLine(e.LeftButton.ToString());
            }
            if (OwnerWindow.GetType() == p.GetType())
            {
                Windows.FloatingWindow v = (Windows.FloatingWindow)OwnerWindow;
                v.UpdateClose();
            }
        }