public override void OnApplyTemplate()
{
base.OnApplyTemplate();
_thumb = GetTemplateChild(PART_Thumb) as Thumb;
if (_thumb != null)
{
_thumb.DragDelta += ThumbDragDelta;
_containingGrid = Parent as Grid;
if (_containingGrid == null)
throw new InvalidOperationException("Gridsplitter only works in grid");
}
SetCursor();
}