private void Header_Drop(object sender, DragEventArgs e)
{
PXSTabItem Source = e.Data.GetData(typeof(PXSTabItem)) as PXSTabItem;
if (Source != null)
{
if ((e.Source as TextBlock).Parent is PXSTabItem)
{
PXSTabItem Target = (e.Source as TextBlock).Parent as PXSTabItem;
if(Target != null)
{
if (!Source.Equals(Target))
{
PXSTabControl Tab = Target.Parent as PXSTabControl;
int SourceIndex = Tab.Items.IndexOf(Source);
int TargetIndex = Tab.Items.IndexOf(Target);
Tab.Items.Remove(Source);
Tab.Items.Insert(TargetIndex, Source);
Tab.Items.Remove(Target);
Tab.Items.Insert(SourceIndex, Target);
}
}
}
}
}
private void Header_PreviewMouseMove(object sender, MouseEventArgs e)
{
PXSTabItem Item = (e.Source as TextBlock).Parent as PXSTabItem;
if (Item != null)
{
if (Mouse.PrimaryDevice.LeftButton == MouseButtonState.Pressed)
{
DragDrop.DoDragDrop(Item, Item, DragDropEffects.All);
}
}
}
http://lovehana.com/487
댓글 영역