/// <summary> /// 将项目移出主窗体独立出去 /// </summary> private void MoveOut(bool move = false) { if (!this.IsOut) { wndDrag drag = new wndDrag(); if (this.Parent is WrapPanel) { drag.IParent = this.Parent as WrapPanel; (this.Parent as WrapPanel).Children.Remove(this); } this.Bdr.Style = this.FindResource("BdrStyleOut") as Style; drag.InnerObj = this; drag.Width = this.iLength; drag.Height = this.iLength; if (move) { drag.Left = Mouse.GetPosition((IInputElement)Manage.WindowMain).X + Manage.WindowMain.Left - Math.Round((this.ActualWidth / 2), 0); drag.Top = Mouse.GetPosition((IInputElement)Manage.WindowMain).Y + Manage.WindowMain.Top - Math.Round((this.ActualHeight / 2), 0); } else { drag.Left = 0; drag.Top = 0; } IsOut = true; drag.Show(); } }
/// <summary> /// 将项目移出主窗体独立出去 /// </summary> private void MoveOut() { if (!this.IsOut) { //if (!(this.Parent is Window)) //{ wndDrag drag = new wndDrag(); if (this.Parent is WrapPanel) { drag.IParent = this.Parent as WrapPanel; (this.Parent as WrapPanel).Children.Remove(this); } this.Bdr.Style = this.FindResource("BdrStyleOut") as Style; drag.InnerObj = this; drag.Width = this.length; drag.Height = this.length; drag.Left = 0; drag.Top = 0; IsOut = true; drag.Show(); //} } }